Suppose you have an id-s list that can contain up to a thousand identifiers for documents inside a database. What is the best way to return these documents?
Should I call a query for each of them or should I specify a giant OR query? maybe there is something better i don't know about
There is: $ in:
db.co.find({_id:{$in:[id1, id2, id3, .., idN]}})
In C # $ in code:
var ids = new int[] {1, 2, 3, 4, 5}; var query = Query.In("name", BsonArray.Create(ids)); var items = collection.Find(query);
Source: https://habr.com/ru/post/900018/More articles:"Password" appears as "********" in IE for the alternate - javascriptAdmob with Android: unable to parse android: configChanges in manifest - androidGridView or TableLayout? - androidFacebook asks 2.0, how do I change the Accept button URL to be a non-Facebook URL? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/900017/how-do-i-send-a-facebook-request-that-links-to-an-external-site&usg=ALkJrhjABg2LBxAd-8ZzpJAER4DWm6WBGwAnonymous function does not return the correct string - stringbuilderRegEx check for decimal numbers with semicolon or period - regex"no ios devices available" on Xcode 4.2 and iOS 5 - iphoneIs there a way in Dojo to find all the descendants of widgets in a DOM element? - dojoNo need to list - pythonAll Articles