统计每个属性的节点数在 Neo4j 数据库中。

huangapple go评论62阅读模式
英文:

count nodes per property neo4j database

问题

我有节点,称为Book。每个节点都有属性Name(所有者的姓名)。名字不多,书很多。如何运行所有Name的聚合查询,以及每个Name的书数量?

Name Book_Count
Sam  55
John 12

数据库版本:3.5

英文:

I have nodes, called Book. Each node have property Name (owner's name). It's not a lot of names, a lot of books. How to run aggregate query of all Names, and book quantity per Name?

Name Book_Count
Sam  55
John 12

Database version: 3.5

答案1

得分: 0

[更新]

这将返回每个名称的节点数量:

MATCH (b:Book)
RETURN b.Name AS name, COUNT(*) AS book_count
英文:

[UPDATED]

This will return the number nodes for each name:

MATCH (b:Book)
RETURN b.Name AS name, COUNT(*) AS book_count

huangapple
  • 本文由 发表于 2023年6月8日 23:39:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76433557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定