is possible in mongo db to select collection\'s documents like in SQL :
SELECT * FROM collection WHERE _id IN (1,2,3,4);
or if i have a
Because mongodb uses bson and for bson is important attribute types. and because _id is ObjectId you must use like this:
db.collection.find( { _id : { $in : [ObjectId('1'),ObjectId('2')] } } );
and in mongodb compass use like this:
{ "_id" : { $in : [ObjectId('1'),ObjectId('2')] } }
Note: objectId in string has 24 length.