1
votes

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.

2
Could you explain which API you used to create the index and add nodes? The Java API and the REST API are quite different in this regard. Perhaps include a few lines of code. Then it would be easier to answer.Craig Taverner
Yes, indeed. I used a Python http api - py2neo.noisyboiler

2 Answers

0
votes

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).

3
votes

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.