nicolewhite/RNeo4j

Feature request: getOrCreateNode flag

ch-ricardor opened this issue · 0 comments

getOrCreateNode

lknU_n <- getOrCreateNode(graph,"Contact" ...

Is it possible to have a flag to know if the node was retrieved or created?

I would like to trigger different actions:

  • after-create
  • on-exists

Scenario:
Merging several file transmissions from different countries using the same db.schema with different or same data included.

Code interpretation:
getOrCreateNode = createNode ( using constraints ) + getNode

node = try(createNode(graph, .label, ...), TRUE)
_constraint validation _
if("try-error" %in% class(node)) {
node = getUniqueNode(graph, .label, props[1])
}

return(node)