Will appreciate your help if you advise me how to solve this question - How do I find a node, that I know a property value of, but don't knot the property name?
For example, I know there is a node with some property value "Richie" and I want to find this node
This is a tricky one. Be aware that a query for this won't use any indexes, as you don't know the property to use.
Here's an example of how to do this using keys(node)
to get the property keys, and node[key]
to do dynamic property access given a string variable for the property name (that we obtain from keys()):
MATCH (p:Person)
WHERE any(key in keys(p) WHERE p[key] = 'Keanu Reeves')
RETURN p
1 Like
Thank you so much for your help, Andrew! Totally solves it!
It's not very efficient though .9