I am trying to use @casl/mongoose with mongoose-paginate-v2 in my express.js app, but the problem is that both libs must be used on the model object.
// trying this
const results = await Person
.accessibleBy(req['ability'])
.paginate({}, options);
// or this, the same problem
const results = await Person
.paginate({}, options)
.accessibleBy(req['ability']);
In both ways, I got either accessibleBy/paginate is not a function because as I said both libs must be used on the model (in my case Person) object.
Any help or suggestion is highly appreciated.