sirdan
sirdan

Reputation: 1028

Neo4j: Count relationships' properties

I have this kind of relationship (:User)-[:COMMENTS]->(:Topic) where :COMMENTS has two properties (tweet and sentiment).

I would like to count and group the several different sentiment included in the relationships, like this kind of output:

How can I do this?

Thank you.

Upvotes: 2

Views: 612

Answers (1)

sirdan
sirdan

Reputation: 1028

Solution found. The query needed is:

MATCH ()-[r:COMMENTS]->() 
return count(r), r.sentiment

Upvotes: 2

Related Questions