mongoose-soft-delete
mongoose-soft-delete copied to clipboard
Cannot update a document with softDelete
I am trying to update a document, but it won't let me, now if I manage to remove the softdelete from the mongo schema it works for me, therefore I think there is a problem with the plugin. I give example:
I hope you can help me.
Hi @cguilarte ,
I am willing to help in this case. I tested the updateMany
with a unit test and it works.
You can find the unit test here.
What is generateId()
in your code? Does it return an ObjectId
object?
Hello @Willis0826 , thank you for responding, I will continue testing and checking that I am not placing something wrong, and yes, generateId returns an objectId, I still tried with other attributes and nothing.
Would be great if you can share a project with me so that I can repro the issue
Any update? I'm facing same issue here
I'm using updateOne() with upsert but not creating new document
@rival14 still nothing, I still have the same problem, for now I have it without soft erasing. @Willis0826 Can you show how you have configured the document schema?
@cguilarte Yes, sure! I tested the functionality using the provided unit test code. You can find the document schema here.
@cguilarte @rival14 Hi, are you still experiencing this issue?
I will close this issue for now. Please feel free to reopen the issue if you are still running into this issue.