Announcement Announcement Module
Collapse
No announcement yet.
I want to count entitynode instead iterate them, is there the function? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • I want to count entitynode instead iterate them, is there the function?

    for example
    I have two type of Node: Group and User ,Group has Iterable users property.

    How I can count the group's memeber without iterated the all of them.
    May be something like "select count(*) from User where group_id=?" instead of "select * from User where group_id=?".
    Does neo4j or spring data provide similar function?
    If not, which way is the best way to do this?

  • #2
    As those are represented by relationships there is currently no other way to count them than to iterate them.

    With the integration of the cypher query language (probably with the next Neo4j-Milestone) there will be aggregate functions like:

    Code:
    start group=(%d) match (group)-[:MEMBER]->(user) return count(*)
    But in the end that doesn't do anything else.

    Cheers

    Michael

    Comment

    Working...
    X