node.js - Mongoose find all items with _id from an array that do exist -
i know can search in mongoose like
schema.find( { '_id' : { $in: [1,2,3]} }, function(err,data){});
my problem e.g. objects _id 1 , 3 exist no object _id 2. find method fail. there way find possible objects ignoring inavlid id_s?
according mongodb documentation, query should not fail no documents exist id of 2.
the documentation states:
the $in operator selects documents value of field equals value in specified array.
Comments
Post a Comment