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

implement soft delete #146

Open
hemedani opened this issue Jan 27, 2024 · 0 comments
Open

implement soft delete #146

hemedani opened this issue Jan 27, 2024 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@hemedani
Copy link
Member

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.

@hemedani hemedani added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant