我可以在不使用 union 且不将标签​​放在一起的情况下使两个边缘标签在一次遍历中下降吗?

Can I make two edge label drop in a single traversal without using union and without putting labels together?

当我这样做时:

g.V(id).as("entity").union(outE("hasType").drop(),outE("createdBy").drop())

两次掉落都发生了

当我这样做时:

g.V(id).as("entity").outE("hasType").drop().outE("createdBy").drop()

只有第一次掉落(可能是我掉落了 createdBy 种类型)

当我这样做时:

 g.V(id).as("entity").outE("hasType").drop().V(id).outE("createdBy").drop()

我认为只有第一次掉落

我知道我可以做这样的事情:

g.V(id).as("entity").outE("hasType","createdBy").drop();

但我想按顺序进行放置,因为遍历是通过代码构建的。所以我需要这样的东西:

g.V(id).as("entity").outE("hasType").drop().back("entity").out("createdBy").drop()

可能吗?

谢谢!

g.V(id).outE("hasType","createdBy").drop()

...是要走的路。您可以在代码中使用标签构建相应的数组。但是,如果由于某种原因这不起作用,那么您仍然可以使用副作用:

g.V(id).sideEffect(outE("hasType").drop()).sideEffect(outE("createdBy").drop())