aravindnc/mongoose-aggregate-paginate-v2

Bug paginator data returned

Tititrois opened this issue · 3 comments

When using the aggregate paginator, only 2 elements are returned: totalCount and Page count. Example:

[ { _id: 5cbeca38bef32a1876900ec6,
       policy: [Object],
       companyLeaveTypeRef: 5cbeca30bef32a1876900ec4,
       type: 'annual',
       data: [] },
     { _id: 5cbeca38bef32a1876900ec8,
       policy: [Object],
       companyLeaveTypeRef: 5cbeca30bef32a1876900ec3,
       type: 'medical',
       data: [] },
     { _id: 5cbeca38bef32a1876900eca,
       policy: [Object],
       companyLeaveTypeRef: 5cbeca30bef32a1876900ec2,
       type: 'unpaid',
       data: [] },
     { _id: 5cbeca38bef32a1876900ecc,
       policy: [Object],
       companyLeaveTypeRef: 5cbeca30bef32a1876900ec1,
       type: 'replacement',
       data: [] },
     { _id: 5cbeca38bef32a1876900ece,
       policy: [Object],
       companyLeaveTypeRef: 5cbeca30bef32a1876900ec0,
       type: 'carry-forward',
       data: [] } ],
  pageCount: 1,
  totalCount: 5 }

The labels are not corresponding to the one describe in the documentation and there is no way to change it. Is it coming from me or this library has not been updated like the other ones ? (I would like to update labels as I use it for the paginate 2).

Thanks

@Tititrois Can you try npm run test inside the package.

@aravindnc nevermind, I just have fucked up with my imports and I didn't pay attention enough. I m really sorry for that, the library is working well.

Sorry for the inconvenience, you can remove this issue.

@Tititrois No worries.. sometimes shit happens!