From 66dc7398700c4fbf5af10e9217ec911232c95050 Mon Sep 17 00:00:00 2001 From: Jonasz Bigda Date: Sun, 8 Nov 2020 19:08:45 +0100 Subject: [PATCH] update dish schema | update Readme | migrate to Atlas --- models/dish.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/models/dish.js b/models/dish.js index c52d678..3a4d9bc 100644 --- a/models/dish.js +++ b/models/dish.js @@ -13,12 +13,11 @@ const dishSchema = mongoose.Schema({ maxlength: 64, required: true, }, - prices: [ - { + prices: { + price1: { priceName: { type: String, maxlength: 60, - required: true }, price: { type: String, @@ -26,7 +25,27 @@ const dishSchema = mongoose.Schema({ required: true } }, - ], + price2: { + priceName: { + type: String, + maxlength: 60, + }, + price: { + type: String, + maxlength: 20, + } + }, + price3: { + priceName: { + type: String, + maxlength: 60, + }, + price: { + type: String, + maxlength: 20, + } + } + }, notes: { type: String, maxlength: 200,