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