简体   繁体   English

Neo4j Cypher查询以查找节点数组的节点ID

[英]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. 我有一个节点集合/数组,我想为其找到数组中每个节点的nodeID。 Something like this - 像这样-

Foreach node in [Nodes] return ID(node) [Nodes]中的Foreach节点返回ID(节点)

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. 这样可以获取节点的Neo4j ID,但是除非有充分的理由,否则不要使用此ID做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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