Paginate the subdocument of a schema
deepakkumardk opened this issue · comments
Deepak Kumar commented
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.
Aravind NC commented
Use aggregate and $unwind.
Aravind NC commented
@deepakkumardk You can use my another plugin for aggregate pagination https://www.npmjs.com/package/mongoose-aggregate-paginate-v2