Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-23-2019 01:46 PM
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
Solved! Go to Solution.
08-23-2019 03:41 PM
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
08-23-2019 03:41 PM
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
08-23-2019 03:47 PM
Thank you so much for your help, Andrew! Totally solves it!
08-28-2019 04:04 PM
It's not very efficient though .9
All the sessions of the conference are now available online