graphaware / neo4j-uuid

GraphAware Runtime Module that assigns a UUID to all nodes (and relationships) in the graph transparently
103 stars 22 forks source link

Feature request : ga.uuid.findNode() returning null #46

Closed tomzeppenfeldt closed 6 years ago

tomzeppenfeldt commented 6 years ago

in short

ga.uuid.findNode() now returns an error if the uuid is not found in the index. Would be great to have it return null instead.

my usecase

I have a number of nodemaps (an export of a source db) and I need to update the target db. The target db does not necessarily contain all the nodes, so it's an update or create. Since we do not know anything about the labels of the nodes that are export, we cannot rely on Neo4j labels.

WITH [
              {labels:['X','Y','Z'],properties:{uuid:'uuid1',propa:'x'}},
              {labels:['A','B','C'],properties:{uuid:'uuid2',propb:'abc'}}
] AS nodemaps

UNWIND nodemaps AS nodemap
RETURN nodemap.properties.uuid, ga.uuid.findNode(nodemap.properties.uuid) IS NULL AS nodeExists

would then be possible.

ikwattro commented 6 years ago

@bachmanm I don't see any objections to this. Thoughts ?

bachmanm commented 6 years ago

Fixed in 3.3.2.51.15

ikwattro commented 6 years ago

even better:)

tomzeppenfeldt commented 6 years ago

cool :) thx guys.