Skip to content

implement soft delete #146

Open
Open
@hemedani

Description

deletion is the most complicated process in Lesan:

  1. remove if any documents created is based on this document.
  2. remove all other documents is based on removed documents.
  3. update all other documents it has relation with removed documents.
  4. remove the actual document.
  5. update all other documents it has relation with removed actual document.

We can also have a series of strategies to implement soft delete, for example appending, subtract or none.

in such a way that:
If the strategy is on subtract, isDeleted will be true on the requested document as well as the documents that were created based on this document, but we will find the documents that are related to the deleted documents and have stored them in an embedded form. To be able to remove the deleted documents from their embed list.
If the strategy is on append, isDeleted will be true on the requested document as well as the documents that are based on this document, and we will also find the documents that are related to the deleted documents and have stored them as an embed. We also set isDeleted to true for deleted documents in their embed list, and we will not consider the limit of the embed list either.
If the strategy was set to none, the documents will be deleted as hardDelete.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions