I'm wondering why these two queries are giving me different results.
START keanu=node(1)
MATCH keanu -[r:ACTED_IN]-> (movieToDelete)
OPTIONAL MATCH movieToDelete -[relationshipsToDelete]- ()
WHERE "Neo" IN r.roles
RETURN movieToDelete, relationshipsToDelete;
And
START keanu=node(1)
MATCH keanu -[r:ACTED_IN]-> (movieToDelete)
WHERE "Neo" IN r.roles
OPTIONAL MATCH movieToDelete -[relationshipsToDelete]- ()
RETURN movieToDelete, relationshipsToDelete;
In the first query, I filter for Neo after the optional match and in the second, I filter for Neo before the optional match. The first query actually returns a row where the r-variable doesn't have a Neo in the roles. However, there is a r-variable, and it does contain a property called roles.