I just started to learn MongoDB database and for my project.
I am trying to implement a MongoDB reference schema.
In my Menu table I would have a food ingredients attributes where it will store the food ingredients.
I am confused about designing my schema.
How am I going to build the schema with the food ingredients in Menu table? Because it might be 100 ingredients, do I need to create an attribute for each of them ? Or I can make one string attribute where I am going to store everything?
Here is an example of it.
var Menu = new Schema({
foodTitle: String,
foodIng: {
title: String,
ingredients: {
rice: String,
beans: String,
meat: String,
cheese: String,
// etc...
}
},
});