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

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -