aravindnc/mongoose-paginate-v2

Paginate the subdocument of a schema

deepakkumardk opened this issue · 2 comments

How to paginate the sub-document of a schema. The model has array of sub-document as of a book can have many authors and I want to paginate the authors.
How to achieve this.

Use aggregate and $unwind.

@deepakkumardk You can use my another plugin for aggregate pagination https://www.npmjs.com/package/mongoose-aggregate-paginate-v2