-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrecipeModel.js
28 lines (26 loc) · 938 Bytes
/
recipeModel.js
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
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const RecipeSchema = new Schema({
recipeName: String,
recipeIngredients: [String],
recipeDirections: [String],
recipeImage: String,
recipeUri: String,
recipeSource: String,
recipeSourceUrl: String,
recipeServings: { type: Number, default: 0 },
recipeCalories: { type: Number, default: 0 },
recipeCaloriesUnits: String,
recipeCarbs: { type: Number, default: 0 },
recipeCarbsUnits: String,
recipeFats: { type: Number, default: 0 },
recipeFatsUnits: String,
recipeProtein: { type: Number, default: 0 },
recipeProteinUnits: String,
userCreated: { type: Boolean, default: false },
usernameCreator: { type: String, default: "" },
isPublished: { type: Boolean, default: false },
pubRequested: { type: Boolean, default: false },
reported: {type: Boolean, default: false}
});
module.exports = mongoose.model('Recipe', RecipeSchema);