Reputation: 10551
MATCH (p:Product {id:'123'}) return p.$color
Where '$color' is a parameter passed from a function which generates the cypher query.
Upvotes: 0
Views: 35
Reputation: 67019
You can get the value of a property named "foo" from a p
node by using the p["foo"]
syntax.
So, if you have a $color
parameter that has the name of a Product
property, this would work:
MATCH (p:Product {id:'123'})
RETURN p[$color];
Upvotes: 1