mixmaxhq / mongo-cursor-pagination

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

added aggregation field to the end #318

Closed thedarkrai07 closed 2 years ago

thedarkrai07 commented 2 years ago

Changes Made

Currently, sort and limits are added at the next index of $match. This leads to other operations in the pipeline applied after the limit query giving wrong results. This change ensures that the sort and limit queries are applied in the end.

Ref: Issue #317

Potential Risks

No risks

Test Plan

Change is straightforward. I have also tested it with one of my projects

Checklist

bradvogel commented 2 years ago

Does this pass unit tests locally?

raphaelbs commented 2 years ago

Hey @thedarkrai07, thanks for your contribution. I'm closing this one because it was solved by https://github.com/mixmaxhq/mongo-cursor-pagination/pull/323. You can use v7.8.0 now.