Hello, I am creating a calorie counting webpage. And I am not sure about MongoDB database schema for food records. It should work like this:
I have a food collection. example:
{
_id: ObjectID("X"),
name: "egg",
calories: 140,
protein: 12,
...
}
(calories and proteins per 100g)
Food records collection. example:
{
food: ObjectID("X"),
count: 3,
weight: 50
}
And I am not sure where to save information about day parts / days. Should I save it in food record?
{
food: ObjectID("X"),
count: 3,
weight: 50,
day: "2015-11-05",
part: "lunch"
}
Or should I create a separate collection for day parts?
Or do you have any other solution? Thanks for your help.