You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filtering by node property can be written in two ways: MATCH (n:person {born:1985}) RETURN n MATCH (n:person) WHERE n.born=1985 RETURN n
However, for relationship properties, it only works in: MATCH p=()-[r]->() WHERE r.role='Tank' RETURN p
but not MATCH p=()-[{role:'Tank'}]->() RETURN p
In the latter writing, the filter does not work. The query returns all relations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Take TuGraph's movie dataset for example,
Filtering by node property can be written in two ways:
MATCH (n:person {born:1985}) RETURN n
MATCH (n:person) WHERE n.born=1985 RETURN n
However, for relationship properties, it only works in:
MATCH p=()-[r]->() WHERE r.role='Tank' RETURN p
but not
MATCH p=()-[{role:'Tank'}]->() RETURN p
In the latter writing, the filter does not work. The query returns all relations.
In Neo4j's documents, it also shows only the first writing (WHERE clause). [{...}] only appears in CREATE.
But in https://stackoverflow.com/questions/68820063/where-condition-in-neo4j-filtering-by-relationship-property people are mentioning the [{...}] way.
Any reasons that [{...}] is not rational, or not suggested, or simply not implemented?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions