summaryrefslogtreecommitdiff
path: root/models/account.js
blob: 2c7376314f6dfcd208b25ed4215e40582d29c56d (plain)
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);