Skip to content
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

get all results- limit:infinity doesn't work. #114

Open
rusiarohit opened this issue Apr 13, 2017 · 1 comment
Open

get all results- limit:infinity doesn't work. #114

rusiarohit opened this issue Apr 13, 2017 · 1 comment

Comments

@rusiarohit
Copy link

Hey Guys,

I used to use the { limit: Infinity, offset: 0 } feature to get all the items while using mongoose paginate module as pagination parameters.

After updating the version of my mongoose and mongoose paginate module it seems to have stopped working. Please suggest the new solution.
limit value must be non-negative

Old NPM version of of mongoose and mongoose paginate.

{"mongodb":"1.4.38", "mongoose": "3.8.8", "mongoose-paginate": "5.0.0"}

New NPM version:

"mongodb":"2.2.16", "mongoose": "4.7.3", "mongoose-paginate": "5.0.0"

Mongo Database Version: 3.2

This is where I learned about infinity feature

Thanks for the help.
RR

@ramonitor
Copy link

Setting limit to Number.MAX_SAFE_INTEGER seems to work fine. Not exactly sure why Infinity is not working, but I guess it has something to do with accepted cursor limits on the Mongo driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants