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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -