However, the line mongoose.Model<UserDocument, UserQueries> shows an error from ts, which is
Generic type 'Model' requires 1 type argument
So when I manually remove "UserQueries", and just use mongoose.Model<UserDocument> instead, everything works just fine.
Not sure if it's due to using a more updated version of mongoose, or something.
Any help is appreciated.
For now I am manually removing the ***Queries like I mentioned, to make this work.
A side-note:
I am a big fan of this tool, and it absolutely makes my work 100 times easier. Much better than the other (sometimes more popular) options out there, which requries you to learn a completely new API just to write the schema, and moreover sometimes it doesn't work. mongoose-tsgen is underrated, and I love the "compiler" approach, it works seamlessly with existing Schema structure.
Right off the bat, I'm new at the whole Typescript and Mongoose, so maybe I am doing something wrong.
I am facing this issue. While using "npx mtgen", it generates UserModel like so
However, the line' requires 1 type argument
mongoose.Model<UserDocument, UserQueries>
shows an error from ts, which is Generic type 'ModelSo when I manually remove "UserQueries", and just use
mongoose.Model<UserDocument>
instead, everything works just fine. Not sure if it's due to using a more updated version of mongoose, or something.Any help is appreciated. For now I am manually removing the ***Queries like I mentioned, to make this work.
A side-note: I am a big fan of this tool, and it absolutely makes my work 100 times easier. Much better than the other (sometimes more popular) options out there, which requries you to learn a completely new API just to write the schema, and moreover sometimes it doesn't work. mongoose-tsgen is underrated, and I love the "compiler" approach, it works seamlessly with existing Schema structure.