How to use $limit and $sort with Q.nbind() in mongoDB How to use $limit and $sort with Q.nbind() in mongoDB mongoose mongoose

How to use $limit and $sort with Q.nbind() in mongoDB


This is very simple just have a look at following code:

    var q = require('q');    var findSomeThing = q.nbind(SomeThing.find,SomeThing);    SomeThing({"someId":"someIdValue"},{},{limit:2}).done(function(data){        //2 records will be retrieved here        console.log(data);    });

Hope this helps you!


You can simple use it like this

RPrayerFind({userId:1},{},{'$limit':10,'$skip':300})