-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
feat(mongodb): Add pagination metadata to the aggregation results #6912
Conversation
public const LIMIT_ZERO_MARKER_FIELD = '___'; | ||
public const LIMIT_ZERO_MARKER = 'limit0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constants are removed. They should have been marked as internal. We can keep them for backward compatibility, but they are useless now that they are not used in the aggregation pipeline.
aeb7cc3
to
eaa37fe
Compare
It looks like the patch is responsible for the failing CI |
56c3a0e
to
adc939b
Compare
@@ -124,7 +124,7 @@ | |||
"doctrine/common": "^3.2.2", | |||
"doctrine/dbal": "^4.0", | |||
"doctrine/doctrine-bundle": "^2.11", | |||
"doctrine/mongodb-odm": "^2.6", | |||
"doctrine/mongodb-odm": "^2.9.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for mocking AddFields
. See release 2.9.2
dd44008
to
abfa2e9
Compare
Thanks to Behat tests. I had totally misunderstood the meaning of limit=0. I thought it meant “infinite”, whereas it actually means zero (I think it should be a error to put zero results per page, but maybe there's a use case). So, to solve this problem, I add an empty array directly to the results rather than building a query that returns nothing. |
abfa2e9
to
b2c2212
Compare
Thanks @GromNaN ! |
Simplifies code by removing the need to extract
firstResult
andmaxResults
from the pipeline, by adding a$setFields
stage to add the litteral informations.This also remove references to the MongoDB
Cursor
and theUnitOfWork
stored in thePaginator
class. I hope this helps preventing memory leak issues.Since I'm modifying the aggregation pipeline, the parameters of the
Paginator
constructor and deleting 2 constants from thePaginator
class, it's best not to merge this as a bugfix.