In relational databases like mysql I was used to do soft delete by setting deleted_at. And then for retrieving SELECT just get rows WHERE deleted_at IS NULL.
I am confused how to implement soft delete in neo4j database. There are multiple ways I am getting but not sure which method or combination will have more advantages.
I also read Neo4j: implementing soft delete with optional relationships but not helping.
Which will be best way or combination or other way to achieve soft delete in neo4j?
I think have a deleted_at
property for node. In which you can store deleted time-stamp.
And at the time of fetching nodes information you can check deleted_at IS NULL
.
like -
MATCH (n:node)
WHERE n.deleted_at IS NULL
RETURN n;
Storing time-stamp you can get when node is deleted.
You can also have relationship deleted_by
between user who deleted the node. So that you can find out who deleted node.