如何将 agtype(顶点或边)转换为常规地图

huangapple go评论43阅读模式
英文:

How to cast an agtype (vertex or edge) to a regular map

问题

一个边缘列表需要根据每个边缘的val属性进行求和。已尝试使用UNWINDsum()函数,但UNWIND不支持agtypes。是否可以将边缘转换为映射以解决此问题,或者您有任何其他替代方案建议吗?

英文:

A list of edges needs to be summed by the val property of each edge. UNWIND and sum() functions were attempted, but UNWIND doesn't support agtypes. Is it possible to cast edges to maps to solve this problem, or do you have any alternative solutions to suggest?

如何将 agtype(顶点或边)转换为常规地图

答案1

得分: 1

将边或顶点强制转换为映射是不受支持的,因此任何尝试对可变长度边的属性求和都将失败。查看GitHub问题中的此评论此处,以获取替代解决方案。

英文:

Typecasting an edge or vertex to map is not supported and hence any attempt to sum the properties of variable length edges will not succeed.
Check this comment here on github issue for alternate solution

答案2

得分: 0

从顶点到映射的强制转换不受支持,因此作为替代,您可以编写自己的函数(更多参考此处)。

另一种替代方案是更新您的 age 存储库(因为已经合并了一个新的PR),然后使用 UNWIND 子句处理边。

英文:

Casting is not supported from vertex to map, so alternately you can write your own function (more reference here).

Another alternate solution would be to update your age repo (as a new PR has been merged) and then use the UNWIND clause to work with edges.

huangapple
  • 本文由 发表于 2023年3月7日 04:26:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75655515.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定