简体   繁体   中英

Neo4j Cypher query to find node IDs for array of nodes

I have a collection/array of nodes for which I want to find the nodeID for every node in the array. Something like this -

Foreach node in [Nodes] return ID(node)

To do what you asked you'd do:

UNWIND ["abc", "def"] as val
MATCH (n:<yourlabel> {Value: val}) //Where 'Value' is your property
RETURN ID(n)

This gets you the Neo4j ID of your nodes, but you should not use this to do anything with unless you really have good cause to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM