Reputation: 187
I have just started learning neo4j.
I am kind of stuck with creating this query.
Query: How many actors have acted in 10 or more movies?
Picture below shows the schema:
Upvotes: 1
Views: 610
Reputation: 41686
If you have larger relationship-counts you might use the node degree directly, which is more efficient.
MATCH (a:Actor)
WHERE size( (a)-[:ACTS_IN]->() ) > 40
RETURN a
Upvotes: 3
Reputation: 10856
MATCH (a:Actor)-[:ACTS_IN]->(m:Movie)
WITH a, count(m) AS movie_count
WEHRE movie_count > 40
RETURN a
Upvotes: 3