This commit is contained in:
2021-02-06 15:25:07 +01:00
parent 047f2660f2
commit 1434918f8e
5 changed files with 55 additions and 10 deletions

View File

@@ -70,6 +70,14 @@ const dishSchema = mongoose.Schema({
kCal: String,
vegan: Boolean,
vegetarian: Boolean,
photos: [mongoose.Types.ObjectId],
ratings: [
{
id: mongoose.Types.ObjectId,
rate: Number,
owner: mongoose.Types.ObjectId
}
]
});
module.exports = mongoose.model("Dish", dishSchema);

View File

@@ -127,6 +127,13 @@ const restaurantSchema = mongoose.Schema({
},
],
dishes: [mongoose.Types.ObjectId],
ratings: [
{
rate: Number,
owner: mongoose.Types.ObjectId,
id: mongoose.Types.ObjectId
}
]
});
module.exports = mongoose.model("Restaurant", restaurantSchema);