如何在 Gremlin 中找到至少有一个单向链接的顶点?
How to find vertices that have at least one single-direction links in Gremlin?
我试图找到与至少一个其他顶点具有单向连接的每个顶点。这就是我所拥有的,但显然是错误的。
g.V().has("label","SomeVertex").as('Vertex').Out().where(__.in().hasNot('Vertex'))
有什么想法吗?谢谢!
您可以尝试类似的方法:
g.V().as('a').
where(out().not(where(out().as('a'))))
我试图找到与至少一个其他顶点具有单向连接的每个顶点。这就是我所拥有的,但显然是错误的。
g.V().has("label","SomeVertex").as('Vertex').Out().where(__.in().hasNot('Vertex'))
有什么想法吗?谢谢!
您可以尝试类似的方法:
g.V().as('a').
where(out().not(where(out().as('a'))))