Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for deletedId #162

Open
AndrewFinlay opened this issue Jan 8, 2025 · 1 comment
Open

Support for deletedId #162

AndrewFinlay opened this issue Jan 8, 2025 · 1 comment

Comments

@AndrewFinlay
Copy link

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.

@kticka
Copy link

kticka commented Jan 28, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants