Hello all,
I am a new joiner to the MongoDB community, and trying to design a database that will fit my app. I would like to create an application (with MEVN full stack framework) to manage our meal.
In a few words, we would like to schedule/plan our meal for the coming week, either by creating new dish in the database, or by selecting one in existing dish list.
Then on the home page, I will display the forthcoming meals.
I will also add a search option to find some meals, to see also special events meals like Christmas or New Year/Eve menu, etc.
I am a little bit confused here on how to model the MongoDB schema, to ease search and queries.
Fyi, as of now we are writing our meals on some sheets of paper
I have read your post and you want data modeling for your meal planner app. I would suggest you to refer MongoDB’s documentation and video tutorials for best practices for schema designing and data modeling. It will provide you with step-by-step guidelines to plan and design schema as per your application requirements.
There are many more resources are also available.
As per my knowledge, I can say you need mainly two collections: 1. dishes 2. meals, and the fields as per your application use case requirement. And for searching you should use the search index to search by dish name or code, events, or by date and also configure indexes for both collections. You need to take those fields as document fields that you want for the searching feature. You can also refer to the documentation for the search index form here.
Are you planning on a desktop or mobile app to allow users to use the app? If so, will the app be on-device only or did you envision sharing data or storing data in Atlas cloud?