From 8170d5bc0544fbc02155b8b57751cd1dec33dd69 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Apr 2021 10:57:50 +0000 Subject: initial public commit --- models/account.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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..2c73763 --- /dev/null +++ b/models/account.js @@ -0,0 +1,30 @@ +const mongoose = require("mongoose"); + +const AccountSchema = new mongoose.Schema({ + bio: { + name: String, + about: String, + website: String + }, + author: { + id: { + type: mongoose.Schema.Types.ObjectId, + ref: "User", + }, + username: String, + }, + recipes: [ + { + type: mongoose.Schema.Types.ObjectId, + ref: "Recipe", + }, + ], + favorites: [ + { + type: mongoose.Schema.Types.ObjectId, + ref: "Recipe", + }, + ] +}); + +module.exports = new mongoose.model("Account", AccountSchema); -- cgit v1.2.3