Hello EveryOne i am working on project where i have collection of product where user can create a custom request/offer on product price so what will be the best approach should i add the offer collection as array or should i create a separate collection for it and save data based on product Idb
Thanks in advance
Skip to main content
26 days later
Hi Abis!
In MongoDB, the query patterns and usage of the data should drive the database model. From what you’re saying, it looks like “Offers” are used separately from “Products”. This means that they’re a standalone entity and should have their own collection. If you’re working regularly with “Offers” outside of the context of “Products” it will be much easier to query a collection of “Offers” than a nested array.
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
C# Custom deserializer for nested collection | 1 | 399 | Jul 2024 |
id and _id both display in the postman output | 0 | 208 | Jul 2024 |
If lot of collections, can the schemaLock time be longer? | 0 | 188 | Aug 2024 |
Mongorestore –gzip –archive restore only specific collection | 6 | 494 | Aug 2024 |
Best Schema design for graphing s4p touchstone files | 0 | 136 | Aug 2024 |