Open garg10may opened 2 years ago
Hello @garg10may,
I'll try to check that. If it not happens till tomorrow please ping me again here.
Thanks for your feedback!
Am 9. Januar 2022 10:37:55 MEZ schrieb garg10may @.***>:
If I am deleting the original document it's not capturing that. Tried using both 'fine' and 'deleteOne' syntax.
return await ppc.deleteOne({ _id: id }); return await ppc.find({ _id: id }).remove();
-- Reply to this email directly or view it on GitHub: https://github.com/codepunkt/mongoose-patch-history/issues/91 You are receiving this because you are subscribed to this thread.
Message ID: @.***>
@garg10may We have tests for the findOne
syntax. Can you try that and report back?
We didn't register deleteOne
currently, since I can't merge right away I won't be able to provide that.
Hey @garg10may are there any updates on this?
As i understand deleteOne can't be captured since mongodb doesn't provide the same. In other lib also deleteOne is not captured.
I tried to get a little into it.
Mongoose doc supports capturing of the deleteOne
method. However it is a little tricky to implement correctly since it can be a query
or a document
hook.
With a little time this could be implemented tho.
What is your opinion on the topic?
Hi there,
Doing await record.remove()
does not seem to save an entry in the change history collection either.
This seems mandatory to me, as I need to know when a record was deleted and by who/what.
Am I mistaken or doing something wrong ?
I can't seem to find a pre('remove')
in your code.
This could/should be added quickly WDTY ?
Thanks
If I am deleting the original document it's not capturing that. Tried using both 'fine' and 'deleteOne' syntax.