I am in search of more information about delete triggers in MongoDB.
Source:
Query on MongoDB Delete Triggers
I am interested in converting DELETE operations to UPDATE + AUTOMATIC DELETE.
- To achieve this, I plan to introduce a new field called "flag" in my collection.
- When I want to delete a specific row, my application will perform an UPDATE operation on that row and set the "flag" field to TRUE (or 1).
My main question is:
Is it possible to define a rule in MongoDB so that:
- If the "flag" field in a particular row is set to a specific value,
- This row should automatically be deleted from the collection?
Thank you