176
rated 0 times
[
180]
[
4]
/ answers: 1 / hits: 6690
/ 10 Years ago, wed, january 14, 2015, 12:00:00
I need to use skip
and limit
for pagination, and the distinct
for not return equal values.
If i use
MyModel.find().distinct('blaster', function(err, results) {
res.render('index', {
data: results
});
});
This works.
If i use
MyModel.find().sort('brand').skip((page-1)*15).limit(15).exec(function(err, results) {
res.render('index', {
data: results
});
});
This is also working, but how use both?
If i try, the error will show:
Error: skip cannot be used with distinct
More From » node.js