Reputation: 105
I am new to this,
I'm trying to use a collection of "Stored Products" that can be individually added to either,.. another collection ("Active Products"), or to an array. Either way, the results will be populated with JQuery to the DOM.
I'm trying to determine what method would be better, easier, possible to do this? As two collections.. or, one main collection and an array, something else?
I'm wanting a person to be able to edit the product from anywhere and have it update globally, so if it's two collections they should be the same objects in each collection, I'm not even sure if that's how mongo works?
Upvotes: 0
Views: 33
Reputation: 381
I probably need to know a bit more information about the difference between stored and active, but from my take if the products are the same I would use 1 collection and just add a flag to the product to indicate the status, either Stored or Active. Also add an index to that flag as you would most likely be querying by that flag.
Upvotes: 1
Reputation: 651
I recommend one collection. Have each product be responsible for it's own property of "stored" or "active." That way, you have a collection that presides over all products and products that are responsible for their status.
Upvotes: 1