neo4j - How do I return the count of multiple relationship types with one query? -


i need stats node based on relationships. example, if had node "celebrity" 3 types of relationships: fan_of, friend_of, , relative_of how can number of fans, friends, , relatives 1 query? know how each relationship type individually, need return them in 1 query.

if understand question is, should close:

start n=node(*)  match n-[r]->m  return n, type(r), count(m) 

you restrict matching relationships types (though none of these exist in sample):

start n=node(*)  match n-[r:fan_of|friend_of|relative_of]->m  return n, type(r), count(m) 

check out , play around here: http://console.neo4j.org/?id=nbba2s


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -