7/6/2014

Sample Code - Mongoose find Array contains ObjectId

✓Mongoose

Get all records where the Ids contains specfic object Id.

  var q= yourCollection.find({ Ids: mongoose.Types.ObjectId('539ba44481973asdfe0c402bc6') });
    q.exec(function (err, items)
    {
        console.info(err);
        console.info(items.length);
    });

Relative Blogs