I would like to have a scene action to merge nodes. I am trying the following cypher, but it doesn't work on Bloom. I couldn't find an explanation from the documentation alone. Could any one help please?
MATCH (n)
WHERE id(n) in $nodes
WITH collect(n) as nodesList
CALL apoc.refactor.mergeNodes(nodesList, {properties:"combine", mergeRels: true})
YIELD node
RETURN node
I would like to do the same thing and have run into the same problem. I am in Bloom version 2.11.0 running on a local DBMS in version 5.26.0. I went into "Experimental Features" and switched on "allow write transactions", and also made sure to tick the option in the Scene Action window to designate the query as a "Write transaction"
I tried:
//merge selected nodes
MATCH (e1:Entity WHERE id(e1) IN $nodes), (e2:Entity WHERE id(e2) IN $nodes)
WITH head(collect([e1,e2])) as nodes
CALL apoc.refactor.mergeNodes(nodes,{
properties:"combine",
mergeRels:true
})
YIELD node
RETURN node;
I used 'id' rather than 'elementId', as I'd had issues with 'elementId' in other scene actions, but tried both and neither worked.
As I've been playing with this, I've noticed that my designation of the scene action as a "write transaction" doesn't save. Each time I open the scene action to make an edit, that box is unchecked. Is this perhaps the culprit behind the scene action failing to execute any changes? Is there some sort of compatibility issue here between apoc functions and the ability to save as a "write transaction"?
As you are using Bloom 2.11.0 it should be noted this was released 1.5 yrs ago, November 2023 and the current Bloom release is 2.20.0. Though I have not investigated anything beyond this but any chance of upgrading?