mixmaxhq / mongo-cursor-pagination

Cursor-based pagination for Mongo
https://www.mixmax.com/careers
MIT License
229 stars 72 forks source link

sort and limit queries in aggregate are sliced instead of pushed #317

Closed thedarkrai07 closed 2 years ago

thedarkrai07 commented 2 years ago

The $sort and $limit are sliced between the aggregate array rather than pushed in the end. This leads to abnormal behaviour while using aggregate.

@leamarty Are you open to fixing it? I can share a PR.

leamarty commented 2 years ago

Hi @thedarkrai07 ! Please share the PR if you already have it in place. Thanks for contributing!

thedarkrai07 commented 2 years ago

Hey @leamarty, I have created the PR. I was not able to increase test coverage as the test cases are already failing. However, I have tested it with a project of mine and it works fine :)

raphaelbs commented 2 years ago

Solved by https://github.com/mixmaxhq/mongo-cursor-pagination/pull/323. Version v7.8.0 supports it.