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 |
---|---|---|---|
Efficiently Querying Large Collections with Complex Conditions - Emmanuel Katto | 1 | 220 | Jul 2024 |
Error in Agrregation in c# | 3 | 45 | Oct 2024 |
IXSCAN with very large keysExamined value | 3 | 77 | Dec 2024 |
(error when fetching) BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer | 1 | 40 | Jan 6 |
Can’t extract geo keys | 1 | 48 | Feb 24 |