Was just wondering if there is a limit to Mongodb's $in function?
http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24in
I have a collection of users (BIG) and have a smaller subset of ObjectIds stashed somewhere, and I want to select all users (collections) that are in my ObjectIds.
Thanks
To insert records in MongoDB and avoid duplicates, use “unique:true”.
While you cannot prevent entries with duplicated data. You can query/aggregate the data in such a way that replicated data is ignored. On the same $group stage you could pick up the max, min, avg etc for a given entry.
To limit the records in MongoDB, you need to use limit() method. The method accepts one number type argument, which is the number of documents that you want to be displayed.
THE ANSWER: 1,525,198 (That's 1.5 million.
Since there's no limit on the number of items in an array as such, you shouldn't have any problem.. For the case when the array is embedded inside a document, you might want to have a look at these:
http://groups.google.com/group/mongodb-user/browse_thread/thread/4a7caeba972aa998?fwc=1
Filtering content based on words
http://groups.google.com/group/mongodb-user/browse_thread/thread/28ae76e5ad5fcfb5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With