noisyboiler
noisyboiler

Reputation: 341

Neo4j Spatial - How To Delete A Node

Having successfully created a spatial index, created a node and added it to my index, I'd now like to be able to delete the node (easy) and remove it from the spatial index (not so easy).

At time of writing, the documentation does not cover this.

Looking at the index i can see what to clear up, but on my simple DB i'm not confident if this is a protocol to follow or just a rule of thumb.

My node (within the index) is two "rtree" relationships away from the root of the layer, which i can clean up, if advised to.

Is there an api to delete my node?

If not, is this a good pattern to tidy up the index once i destroy the node in the graph?

Thanks.

Upvotes: 1

Views: 240

Answers (2)

Peter Neubauer
Peter Neubauer

Reputation: 6331

Yes, cleaning the index after a node removal is the right thing to do. a PR would be most welcome! Also, make sure removal is idempotent (I believe it already is).

Upvotes: 0

Stefan Armbruster
Stefan Armbruster

Reputation: 39915

When you delete a node it should be automatically removed from any index to prevent orphaned entries. If you experience a different behaviour, I'd consider this being a bug.

Upvotes: 3

Related Questions