aravindnc / mongoose-aggregate-paginate-v2

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

Bug paginator data returned #2

Closed Tititrois closed 5 years ago

Tititrois commented 5 years ago

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

aravindnc commented 5 years ago

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

Tititrois commented 5 years ago

@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.

aravindnc commented 5 years ago

@Tititrois No worries.. sometimes shit happens!