I have been trying to implement “deletion” for nodes that satisfy a certain criterion. I delete a node by removing incoming edges to and outgoing edges from it.
My understanding is that, by dgraph design, the node itself and the values it contains continue to exist after these edges have been removed. The values can be set to null, but they continue to consume memory. Please correct me if this understanding is wrong.
I have two questions. Firstly, these nodes continue to be retrieved by queries, which I would like to avoid. I can accomplish this by setting an additional field in each node, which signifies whether it has been deleted. Is there another way to do this?
Secondly, what exactly happens when a uid is “recycled”? I assume this means that this uid is now available to be assigned to another node. But, what exactly happens to the node whose uid is recycled?
Also, I would highly appreciate some sample syntax to recycle a node using the go client – I didn’t see any syntax to do this on the website.