Hey @Gabriel_Pavao,
Welcome to the MongoDB Community forums
In MongoDB, collections are used to group related documents and provide an organized structure for storing data. It is recommended to create a new collection when there is a logical separation or when the data in the collection has a different structure or purpose. Doing so allows us to maintain data organization and improves query performance.
When considering whether to create a new collection, think about the distinct characteristics or access patterns of the data. For example, if you have an e-commerce application that stores information about both products and customers. In this case, you might create separate collections for “products” and “customers” to maintain the different attributes and relationships associated with each entity.
On the other hand, if a customer has multiple shipping addresses, you can choose to embed the shipping addresses as an array within the “customer” document. This avoids the need to create a separate “shipping addresses” collection.
Also if you’re starting your MongoDB journey, I would recommend the following resources:
- MongoDB Schema Design Best Practices
- Data Model Design
- 6 Rules of Thumb for MongoDB Schema Design: Part 1
- The free MongoDB University courses, especially M320 Data Modeling
These resources will provide you with valuable insights for designing effective MongoDB schemas.
Best regards,
Kushagra