summaryrefslogtreecommitdiff
path: root/models/account.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/account.js')
-rw-r--r--models/account.js30
1 files changed, 30 insertions, 0 deletions
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);