How do I perform an id array query in Mongoose? [duplicate]

Here is a mongoosey way to use the $in operator.

User.find()
  .where('fb.id')
  .in([3225, 623423, 6645345])
  .exec(function (err, records) {
    //make magic happen
  });

I find the dot notation quite handy for querying into sub documents.

http://mongoosejs.com/docs/queries.html

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)