收集后无法检索身份和标签在密码中放松
我正在处理一个非常复杂的查询,其中涉及一些展开和收集,并将不同类型的节点混合在一起。最后,我留下了一张地图列表。 当我返回列表时,我看到每个元素都有属性 identity
、labels
和 properties
。
但是,我似乎无法通过键 map_element.identity
检索 identity
和 labels
的值,也无法使用 <代码>map_element[“身份”]。 我尝试使用函数 ID
和 labels
但它给了我错误,该元素是地图而不是节点。
用于测试任何数据以了解我的意思的基本查询:
MATCH (a), (b)
WITH collect(a) + collect(b) as collected
UNWIND collected as unwinded
RETURN unwinded, unwinded.identity
您会注意到在 unwinded
列中,identity
、labels
和 properties
存在,但是 unwinded.identity
为 null
I'm working on a pretty complex query which involves some unwinds and collects, and mixes together different types of nodes. At the end of it, I'm left with a list of maps.
When I just return the list, I see that each element has the attributes identity
, labels
, and properties
.
However, I don't seem to be able to retrieve the value of identity
and labels
through the key, map_element.identity
, nor with map_element["identity"]
.
I've tried using the functions ID
and labels
but it gives me the error that the element is a map and not a node.
Basic query to test on any data to see what I mean:
MATCH (a), (b)
WITH collect(a) + collect(b) as collected
UNWIND collected as unwinded
RETURN unwinded, unwinded.identity
You will notice that in the unwinded
column, identity
, labels
, and properties
are present, however unwinded.identity
is null
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过
id(unwinded)
和labels(unwinded)
?Did you try
id(unwinded)
andlabels(unwinded)
?ID 函数相当于获取该身份属性:
https: //neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-id
对于标签,它是相同的标签函数:
https://neo4j.com/docs/cypher-manual /current/functions/list/#functions-labels
ID function is the equivalence of getting that identity property:
https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-id
For labels, it is the same labels function:
https://neo4j.com/docs/cypher-manual/current/functions/list/#functions-labels