recipe.js 560 B

1234567891011121314151617181920212223
  1. const mongoose = require("mongoose");
  2. const RecipeSchema = new mongoose.Schema({
  3. cloverId: {
  4. type: String,
  5. required: true
  6. },
  7. name: {
  8. type: String,
  9. required: true,
  10. minlength: [3, "Name of recipe must contain at least three characters"]
  11. },
  12. // merchant: {
  13. // type: mongoose.Schema.Types.ObjectId,
  14. // ref: "Merchant"
  15. // },
  16. ingredients: [{
  17. type: mongoose.Schema.Types.ObjectId,
  18. ref: "Ingredient"
  19. }]
  20. });
  21. module.exports = mongoose.model("Recipe", RecipeSchema);