-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mongoose type error #57
Comments
+1, ESLint throwing errors when calling extended methods ( |
To fix that typing issue install package @types/mongoose-delete ( |
@adrianjarc would it be worth adding something on this into the Read Me? |
@ajmas It would. But as I look at the state of this repository, I highly doubt it will get merged, even if I or anyone else makes this PR |
@adrianjarc @ajmas If you add some README instructions and create PR, I will be happy to check and merge it. |
I have created a PR with an example in Typescript. @adrianjarc if you have any suggestions on improving the example, please let me know. |
Hi,
I'm trying to run the library on a typescript project. I have [email protected] and @types/[email protected]. I am using the plugin as per the instructions. I also have:
interface ItemStructure extends Document {
...
}
const ItemSchema = new Schema({ ... })
ItemSchema.plugin(mongoose_delete, { overrideMethods: 'all' });
export const Item: Model = model(
'item',
ItemSchema
);
For some reason it appears that there is no delete function on type Model event after I extend the Item interface with said method. I am trying to replace some findByIdAndRemove query's with soft delete.
Error:
Property 'delete' does not exist on type 'Model<ItemStructure, {}>'
Additional info:
"os":"linux","arch":"x64"
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: