-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit option on Find() not working #93
Comments
Sorry for the late response. There's no 1 req.db.models.Customer.find().limit(req.query.limit).offset(req.query.offset).get(function (err, results) {
// ...
}); 2 req.db.models.Customer.find({}, req.query.limit, { offset: req.query.offset }, function (err, results) {
// ...
}); You can mix them, but |
It's still available has it was, the move is internal
I tried your second suggestion and received an error in "order clause". I will pull your latest code and try that. |
That's probably because |
This is the only version that worked for me. The second example seems to ignore the offset even with the parseInt. module.exports = function (app) {
app.get("/comment", function (req, res) {
req.db.models.Comment.find().limit(parseInt(req.query.limit)).offset(parseInt(req.query.offset)).run(function (err, results) {
console.log(err);
var response = {
results : [],
success : false
};
response.total = results.length;
response.results = results;
res.send(response);
});
}); |
I found the issue, it was because when doing |
I am adding the limit and offset options to my find method but only the offset is being applied. I also tried hard coding the values but I got the same result.
The text was updated successfully, but these errors were encountered: