1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
|