You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
If you install the plugin globally mongoose.plugin(MongoosePaginateV2), TypeScript won't understand that model.paginate is a valid function.
Describe the solution you'd like
Create a global type definition on Model interface to paginate.
There is one catch though, this will type all models even when not using paginate.
Probably there as a nice way to toggle this, but I can't think on one yet.
Describe alternatives you've considered
Copy and paste this code on a .d.ts file on the project.
An alternative and simple solution for that would be include this on the README.
Additional context
That's all.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
If you install the plugin globally
mongoose.plugin(MongoosePaginateV2)
, TypeScript won't understand thatmodel.paginate
is a valid function.Describe the solution you'd like
Create a global type definition on Model interface to paginate.
There is one catch though, this will type all models even when not using paginate.
Probably there as a nice way to toggle this, but I can't think on one yet.
Describe alternatives you've considered
Copy and paste this code on a
.d.ts
file on the project.An alternative and simple solution for that would be include this on the README.
Additional context
That's all.
The text was updated successfully, but these errors were encountered: