【发布时间】:2017-07-16 00:52:19
【问题描述】:
如何在一次调用中将一条边从一个顶点添加到多个顶点?我知道我可以使用单个顶点调用通常的 addEdge,但我想避免为我需要添加的每个边缘调用 gremlin 服务器,因为可能有很多。
这在 3.2.3 版本中有效,但 V 方法在 3.0.1 版本中不可用,因此希望以另一种方式复制它。
// Get vertices I want to add edge to
g.V().has("id",within(["2","3","4"])).as("toV").
// Now get the vertex I want to add edge from
V("1").as("fromV").
// And add an edge between them
addE("likes").from("fromV").to("toV")
【问题讨论】:
-
您使用哪个版本的 TinkerPop?您的最后一个查询使用 v3.2.x 应该没问题。
-
由于 dynamodb 存储后端,我现在被困在 3.0.1-incubating 上。
-
答案已更新以反映这一点。
标签: amazon-dynamodb titan gremlin tinkerpop3 gremlin-server