aravindnc / mongoose-aggregate-paginate-v2

A cursor based custom aggregate pagination library for Mongoose with customizable labels.
MIT License
131 stars 23 forks source link

Feature/support for prepagination #58

Closed Akalanka47000 closed 2 months ago

Akalanka47000 commented 2 months ago

Hello, this is a solution which I happened to think of while trying to optimize a couple of resource intensive queries. It allows someone to control where exactly in the pipeline should the pagination (skip and limit) should run while preserving the existing behavior of the plugin (Attached below is a test output). Further I believe this addresses the issues #57 and #48.

Please do let me know your thoughts on this if you do find the time. I also added in the type definitions from the https://www.npmjs.com/package/@types/mongoose-aggregate-paginate-v2 package directly into this so that it becomes easier to maintain.

image