cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Querying similar queries with different results

I am running two queries which I believe to be identical in the task they are performing. I am working on exercise 12.4, which you can gain access to by running this :play 4.0-intro-neo4j-exercises

I am running this query which produces the desired results of retrieving labels Movie and Production

MATCH (m)
WHERE m.title = 'Forrest Gump'
RETURN  labels(m)

but when I run this query

Match (m:Movie {title: 'Forrest Gump'})
RETURN labels(m)

I only receive the Movie label. Are the two queries above not the same? Why am I getting different results?

1 ACCEPTED SOLUTION

On the 2nd query you have :Movie which means that it will only find nodes that have the Movie label. If you remove that bit it'll be the same as the top query

View solution in original post

1 REPLY 1

On the 2nd query you have :Movie which means that it will only find nodes that have the Movie label. If you remove that bit it'll be the same as the top query