Automattic / Automattic/mongoose
Feature: Soft-Delete
- Dominant language
- JavaScript
- Stars
- 27.5k
- Forks
- 4k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 35
Description
**Do you want to request a *feature* or report a *bug*?**
feature
**What is the current behavior?**
Deleting a document in mongoose really deletes it from the database.
**What is the expected behavior?**
We should be able to enable an option to let documents be "soft-deleted". Meaning, there should be an attribute like `_deleted` on each document and deleting a document by the normal mongoose way will jsut mark the document as deleted. Find-queries will, by default, all skip/exclude documents that are marked as "deleted". By options, one can still hard-delete documents or find-query including or only deleted documents.
There are 2-3 plugins for that but they are not maintained in any way, nor do they have a considerable amount of downloads and their last commit is over 3 years old.
I, and many others that will be working with mongoose in professional environments, will love that feature.
**Please mention your node.js, mongoose and MongoDB version.**
All latest versions
Contributor guide
Research direction
No files, tests, or entry points are identified in the issue. Start by reviewing the requested soft-delete behavior and its options for deleting and finding documents; done would require an agreed design and corresponding implementation across those operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100