summaryrefslogtreecommitdiff
path: root/models/recipe.js
diff options
context:
space:
mode:
authorroot <root@vagrantz.xyz>2021-04-06 10:57:50 +0000
committerroot <root@vagrantz.xyz>2021-04-06 10:57:50 +0000
commit8170d5bc0544fbc02155b8b57751cd1dec33dd69 (patch)
treed5cffb086fe6d5585c1e00ea5d5d2d907e6d2cd6 /models/recipe.js
initial public commitHEADmaster
Diffstat (limited to 'models/recipe.js')
-rw-r--r--models/recipe.js30
1 files changed, 30 insertions, 0 deletions
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);