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/recipe.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 models/recipe.js (limited to 'models/recipe.js') diff --git a/models/recipe.js b/models/recipe.js new file mode 100644 index 0000000..e866f5f --- /dev/null +++ b/models/recipe.js @@ -0,0 +1,30 @@ +const mongoose = require('mongoose'); + +const recipeSchema = new mongoose.Schema({ + title: String, + picture: String, + category: String, + ingridients: [String, String], + isLiked: Number, + steps: [ + { + type: mongoose.Schema.Types.ObjectId, + ref: 'Step' + } + ], + author: { + id: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User' + }, + username: String + }, + comments: [ + { + type: mongoose.Schema.Types.ObjectId, + ref: 'Cmmnt' + } + ] +}); + +module.exports = new mongoose.model('Recipe', recipeSchema); -- cgit v1.2.3