Closed ahmedmagdy11 closed 3 years ago
Same With me
i used findDeleted but result was find all documents in DB :(( anyone help me
@cthanh2310 I think most of the use cases for findDeleted
will be in requests that don't need to be optimized aka (sped-up) so you can results.filter(doc => return doc.deleted;)
Omg tks very much ! i fixed bug .With a newbie as me, I'm so happy <3. But i see video https://www.youtube.com/watch?v=dstdrBsf7ag&list=PL_-VfJajZj0VatBpaXkEHK_UPHL7dW6I3&index=32 in 29:06 it's no problem @@
Omg tks very much ! i fixed bug .With a newbie as me, I'm so happy <3. But i see video https://www.youtube.com/watch?v=dstdrBsf7ag&list=PL_-VfJajZj0VatBpaXkEHK_UPHL7dW6I3&index=32 in 29:06 it's no problem @@
@cthanh2310 In this video, all records had already been deleted so all documents in DB had the field 'deleted' set to be true and it still worked. However, if some records are never be deleted, they will not have the field 'deleted' in DB. mongoose-delete use $ne operator when calling findDeleted, so if some records do not have the field 'deleted' (marked as they are not deleted), they are still be included in the result of this function.
replace findDeleted({}) to findWithDeleted({deleted:true})
replace findDeleted({}) to findWithDeleted({deleted:true})
oh thank you so much it's work with me
replace findDeleted({}) to findWithDeleted({deleted:true})
it's work correctly, but i don't understand why findDeleted
doesn't work the same way as it does in this video, https://www.youtube.com/watch?v=dstdrBsf7ag&list=PL_-VfJajZj0VatBpaXkEHK_UPHL7dW6I3&index=30
i have no problem that
findDeleted
return both deleted and non-deleted data, but at least allow me to apply{deleted : true}
filter also appreciate your work Thanks for this cool package