-
Notifications
You must be signed in to change notification settings - Fork 7
Cypher Aggregation
SepiaGroup edited this page Dec 9, 2011
·
2 revisions
- Count nodes
- Group Count Relationship Types
- Count entities
- Count non null values
- SUM
- AVG
- MAX
- MIN
- COLLECT
- DISTINCT
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2));
cypher.Match(m => m.Node("n").To().Node("x"));
cypher.Return(r => r.Node("n").Count("*"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2));
cypher.Match(m => m.Node("n").To("r", null).Node());
cypher.Return(r => r.Type("r").Count("*"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2));
cypher.Match(m => m.Node("n").To().Node("x"));
cypher.Return(r => r.Count("x"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2, 3, 4, 1));
cypher.Return(r => r.Count("n.property?"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2, 3, 4));
cypher.Return(r => r.Sum("n.property"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2, 3, 4));
cypher.Return(r => r.Avg("n.property"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2, 3, 4));
cypher.Return(r => r.Max("n.property"));
var tblResults = cypher.post();
var cypher = new Cypher();
cypher.Start(s => s.Node("n", 2, 3, 4));
cypher.Return(r => r.Min("n.property"));
var tblResults = cypher.post();
NOT SUPPORTED AT THIS TIME
var cypher = new Cypher();
cypher.Start(s => s.Node("a", 2));
cypher.Match(m => m.Node("a").To().Node("b"));
cypher.Return(r => r.Count("distinct b.eyes"));
var tblResults = cypher.post();