收集后无法检索身份和标签在密码中放松

发布于 2025-01-13 05:04:18 字数 705 浏览 0 评论 0原文

我正在处理一个非常复杂的查询,其中涉及一些展开和收集,并将不同类型的节点混合在一起。最后,我留下了一张地图列表。 当我返回列表时,我看到每个元素都有属性 identitylabelsproperties

但是,我似乎无法通过键 map_element.identity 检索 identitylabels 的值,也无法使用 <代码>map_element[“身份”]。 我尝试使用函数 IDlabels 但它给了我错误,该元素是地图而不是节点。

用于测试任何数据以了解我的意思的基本查询:

MATCH (a), (b)
WITH collect(a) + collect(b) as collected
UNWIND collected as unwinded
RETURN unwinded, unwinded.identity

您会注意到在 unwinded 列中,identitylabelsproperties 存在,但是 unwinded.identitynull

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李白 2025-01-20 05:04:18

您是否尝试过 id(unwinded)labels(unwinded)

Did you try id(unwinded) and labels(unwinded) ?

离线来电— 2025-01-20 05:04:18

ID 函数相当于获取该身份属性:

https: //neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-id

对于标签,它是相同的标签函数:
https://neo4j.com/docs/cypher-manual /current/functions/list/#functions-labels

MATCH (a), (b)
WITH collect(a) + collect(b) as collected
UNWIND collected as unwinded
RETURN unwinded, ID(unwinded), unwinded.<property>

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

MATCH (a), (b)
WITH collect(a) + collect(b) as collected
UNWIND collected as unwinded
RETURN unwinded, ID(unwinded), unwinded.<property>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文