You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For `find` operations within the Local API, you can disable pagination to retrieve all documents from a collection by passing `pagination: false` to the `find` local operation.
This doc show an example with limit together with pagination disabled
Both mongoose-paginate-v2 & mongoose-aggregate-paginate-v2 have in their docs that [pagination] {Boolean} - If pagination is set to false, it will return all docs without adding limit condition. (Default: True)
I believe that the root cause is that mongoose-paginate-v2 actually does use the limit even if pagination is turned off. Which I would consider a bug.
Describe the Bug
When using MongoDB and setting a limit together with
pagination: false
it will behave differently if the collection has a join field or not.I think that the expected behavior is that limit should be ignored. It's a bit confusing though.
payload/docs/queries/pagination.mdx
Line 65 in b1734b0
payload/docs/local-api/overview.mdx
Line 150 in b1734b0
[pagination] {Boolean} - If pagination is set to false, it will return all docs without adding limit condition. (Default: True)
I believe that the root cause is that mongoose-paginate-v2 actually does use the limit even if pagination is turned off. Which I would consider a bug.
Link to the code that reproduces this issue
https://github.com/stofolus/mongo-join-bug
Reproduction Steps
There are two collections where one have a join field and one does not. They should return the same information on the page.
Which area(s) are affected? (Select all that apply)
db-mongodb
Environment Info
The text was updated successfully, but these errors were encountered: