I was wondering what would be the most efficient method to query a user’s items.
I could query for all items containing the user's id with db.collection.find( { users: userID } ) or store each item id of a user in the user itself and query them from that array with db.collection.find({ "_id": { "$in": [userItemsIDs] } }).
Is one method better than the other?
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/a8d5eaf0-cb40-4c0f-9750-ba9cc75d5801%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.