Two-way tabulation with cypher, neo4j -


i have network 2 types of nodes: (n:type1)-[r]->(m:type2). type1 nodes have property, called, can take values true or false. query each node of type2, gives total of true's , falses' nodes related it.

i in 2 passes:

match (n:type1)-[r]->(m:type2) n.called return m.id, count(n); match (n:type1)-[r]->(m:type2) not n.called return m.id, count(n); 

but able in 1 query.

try this

match (n:type1)-[r]->(m:type2)  return m.id, n.called, count(n); 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -