collection.aggregate([ { $match:{ id :{ "$in" : document.friends}, } } ]).exec(function ( e, d ) { console.log( d ) if(!e){ // your pre when got data successfully }else{ // your pre when you got the error } });


