aravindnc / mongoose-aggregate-paginate-v2

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

Global options config #37

Closed horvathpatrik closed 2 years ago

horvathpatrik commented 2 years ago

The global settings feature is broken, i can't access aggregatePaginate object.

index.js should contain module.exports.aggregatePaginate = aggregatePaginate; to fix it

Spown commented 2 years ago

can confirm. also, conventionally plugin config occurs before schema is sent to produce the model.

schema.plugin(aggregatePaginate({...config: here}));
model = db.model('name', schema)
intenser commented 2 years ago

+1

Any workaround available?

aravindnc commented 2 years ago

Fixed in new version.