-
Notifications
You must be signed in to change notification settings - Fork 276
Neo4j::cypher aggregation
andreasronge edited this page Oct 1, 2012
·
4 revisions
Read first how aggregation works here: http://docs.neo4j.org/chunked/1.8/query-aggregation.html
COUNT is used to count the number of rows. COUNT can be used in two forms — COUNT(*) which just counts the number of matching rows, and COUNT(), which counts the number of non-null values in .
Example, count my friends
node(1).outgoing(:friends).count
Same as START v2=node(1) MATCH (v2)-[:
friends]->(v1) RETURN count(v1)
Example: To count the number of nodes, for example the number of nodes connected to one node, you can use
ret node(1).outgoing,count
Same as START v1=node(1) MATCH (v1)-->(v2) RETURN v2,count(*)
WARNING: Much of the information in this wiki is out of date. We are in the process of moving things to readthedocs
- Project Introduction
- Neo4j::ActiveNode
- Neo4j::ActiveRel
- Search and Scope
- Validation, Uniqueness, and Case Sensitivity
- Indexing VS Legacy Indexing
- Optimized Methods
- Inheritance
- Core: Nodes & Rels
- Introduction
- Persistence
- Find : Lucene
- Relationships
- Third Party Gems & extensions
- Scaffolding & Generators
- HA Cluster