Closed johnH872 closed 9 months ago
Looks like findDeleted returns all records except records that have deleted = false. So when I used restore it removed the field 'deleted'. That causes the record I restored to still be found by findDeleted.
same with me, when I used restore, the field 'deleted' was removed instead of being changed to 'false'."
same with me, when I used restore, the field 'deleted' was removed instead of being changed to 'false'."
I found the same.
Because we are using this query to get all "deleted" documents (here) this is expected behavior.
return Model[modelMethodName].apply(this, arguments).where('deleted').ne(false);
You can try to use TestSchema.plugin(mongoose_delete, {overrideMethods: 'all', use$neOperator: false});
to get only deleted===true
documents
When I use findDeleted, I found all records instead of records with deleted = true