更新时间:2022-05-05 23:24:44
如果有顶点ID,则按ID查找是非常有效的.如果您使用的是Gremlin Server,则对Gremlin Server的每个请求都将被视为单个事务.您可以对单个请求(带有绑定)在Gremlin查询中传递多个语句,而不是发送多个请求.用分号分隔Gremlin查询中的语句.
If you have the vertex ids, it is very efficient to lookup by id. If you are using Gremlin Server, each request to the Gremlin Server is treated as a single transaction. You can pass the multiple statements in a Gremlin query on a single request (with bindings) rather than sending multiple requests. Separate the statements in the Gremlin query with semicolons.
l=[4200, 4355, 4676]; v=graph.vertices(4100).next(); l.each { v.addEdge("knows", graph.vertices(it).next()) }