mongoose-delete icon indicating copy to clipboard operation
mongoose-delete copied to clipboard

Support for `deletedId`

Open AndrewFinlay opened this issue 10 months ago • 1 comments

We use mongoose-delete heavily in our application and sometimes we have a need to delete multiple documents across different collections as a part of a single delete action.

I was thinking that it'd be nice to be able to provide a unique id to mongoose-delete when a document is deleted so that we can use it later to easily restore those documents.

AndrewFinlay avatar Jan 08 '25 07:01 AndrewFinlay

I faced similar problems, and since this plugin hasn't been updated/maintained for a while, I decided to create my own. It supports hooks/middleware for delete operations, custom field names and so on.

https://github.com/kticka/mongoose-smart-delete?tab=readme-ov-file#real-life-example-with-custom-batchid-attribute

kticka avatar Jan 28 '25 08:01 kticka