Filtering by relationship property within [] #161
CAQ
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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