I have these relations:
NodeType1 A {ts:11} =r1=> NodeType2 m
NodeType1 B {ts: 22} =r1=> NodeType2 m
NodeType1 Y {ts: 22} =r1=> NodeType2 n
NodeType1 Z {ts: 32} =r1=> NodeType2 n
NodeType1 X {ts: 23} =r1=> NodeType2 o
.......
For each NodeType2, I wish to get max/min ts property NodeType1 who relate to it by r1
NodeType1 A {ts:11} =r1=> NodeType2 m
NodeType1 B {ts: 22} =r1=> NodeType2 m
NodeType1 Y {ts: 22} =r1=> NodeType2 n
NodeType1 Z {ts: 32} =r1=> NodeType2 n
NodeType1 X {ts: 23} =r1=> NodeType2 o
Merge Nodes:
MATCH (n1:NodeType2)
WITH n1.name as name, collect(n1) as nodes
CALL apoc.refactor.mergeNodes(nodes, {properties: "combine"}) YIELD node
RETURN node
MATCH (n1:NodeType1)
WITH n1.name as name, collect(n1) as nodes
CALL apoc.refactor.mergeNodes(nodes, {properties: "combine"}) YIELD node
RETURN node
Aggregation Query: Example for node m
match (n1:NodeType1 ) -[r1]-> (n2:NodeType2 {name:'m'})
with n2, max(n1.ts) as maxval, min(n1.ts) as minval
return n2, maxval,minval
Yes。We can send many times parameterized query to neo4j server, But this need many times net io, and cause inconsistency, unless do a explict trx.begin(), Is there any way to send a non parameterized query to finish it
I understood what he meant, I have the same question.
I've blown a "merge" statement, so now I have too many nodes (with a specific label) to "DETACH DELETE" in one transaction. So I want to do an operation that in SQL I would accomplish with a "GROUP BY" -- I want to somehow match a group of nodes based on an attribute, "DETACH DELETE" each of those (in a single transaction), then iterate until all the nodes are gone.
I'm new to Cypher, and so I'm still struggling to understand the semantics of these group operators.
On a related note, is there any way to perform multiple transactions (inside a subquery or something) from the neobrowser (the tool that comes up on port 7474)?