Open jdhrivas opened 1 week ago
It looks like you are using the wrong type reference. DeletedMethods
are the instance methods on the document (submission.delete()
), not the static methods. To use the static methods you need to import DeletedStaticMethods
. See example in the README
import { DeletedStaticMethods, DeletedMethods } from 'mongoose-delete-ts';
...
private SubmissionModel: Model<SubmissionDocument, {}, DeletedMethods> & DeletedStaticMethods,
I'm applying the mongoose-delete-ts plugin globally. Any thoughts?
Error message: Property 'deleteById' does not exist on type 'Model<SubmissionDocument, {}, {}, {}, Document<unknown, {}, SubmissionDocument> & Submission & Document<unknown, any, any> & Required<...>, any> & DeletedMethods'.ts(2339)