Closed lea0o0oo closed 3 months ago
@lea0o0oo have you tried adding it in hooks? like
export const ProjectSchema = defineMongooseModel({
name: "Project",
schema: {
...
},
hooks(schema) {
schema.plugin(mongoosePaginate)
},
});
It works! Thank you so much, and sorry for the inconvenience
@lea0o0oo glad it works oh no worries at all! you can always open an issue no matter what
Now, the problem are types, it doesent know what Schema.paginate does. Is there a way to make it know what it is?
is there any example for typescript support with mongoose-paginate-v2?
sorry not that I know of
How can I attach plugins to my schema?
I want to add pagination with mongoose-paginate-v2, but the
.plugin()
function does not exist in the schema