aravindnc/mongoose-aggregate-paginate-v2

[Feature Request] Too much information in return data

denmasyarikin opened this issue · 1 comments

i like customLabels option it usefull for me, but it will be better if visibility of fields can also customized via options.

Suggestion

const options = {
        limit: 10,
        page: 1,
        customLabels: {
          totalDocs: 'total',
          docs: 'data',
          limit: 'limit',
          page: 'page',
          totalPages: 'pages',
          nextPage: false,
          prevPage: false,
          hasPrevPage: false,
          hasNextPage: false,
          pagingCounter: false
        }
      }

so if value has a falsy, it will removed from the object.

@denmasyarikin Added customLabels.meta to handle this. use latest version 1.0.5.