From 188527c6b55a2d64d5f76c5d3e094da45c69b0c9 Mon Sep 17 00:00:00 2001 From: BakedSnake Date: Wed, 17 Mar 2021 12:58:53 +0100 Subject: Public version --- models/account.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 models/account.js (limited to 'models/account.js') diff --git a/models/account.js b/models/account.js new file mode 100644 index 0000000..d6f43b4 --- /dev/null +++ b/models/account.js @@ -0,0 +1,21 @@ +const mongoose = require("mongoose"); + +const AccountSchema = new mongoose.Schema({ + name: String, + email: String, + author: { + id: { + type: mongoose.Schema.Types.ObjectId, + ref: "User", + }, + username: String, + }, + posts: [ + { + type: mongoose.Schema.Types.ObjectId, + ref: "blogPost", + }, + ], +}); + +module.exports = new mongoose.model("Account", AccountSchema); \ No newline at end of file -- cgit v1.2.3