>
> Yes, I understood that. But I think you should be explicit about which
> relationship types you *expect* to remove. This means that if the node had
> relationships of types that you didn't expect those will not be removed and
> an exception will be thrown when you commit the transaction. This is a good
> thing, since it helps you detect errors in your code. If for example the
> node is part of an in-graph data structure, it would probably have to be
> gracefully removed from that data structure, just removing all of the
> relationships from the node would probably break the data structure. I
> would
> much prefer the utility methods to aid you by signaling that you forgot to
> remove the node, by throwing an exception, than to silently break your data
> structures.
>

One convenient convention I use that is a kind of compromise here is that I
assume each node has some level of ownership of the outgoing relationships,
but not the incoming ones. So I delete all incoming relationships directly,
but only explicitly delete the outgoing relationships of the types I expect,
before finally deleting the node. So I don't care if there is a mistake in
the incoming relationships, but do care if there is a mistake in the
outgoing ones.

I guess this pattern may only suite the conventions of my data model.
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to