Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Gremlin 查找与特定节点共享双向边的所有节点的最直接方法是什么?例如,我想查找我关注的所有用户,这些用户也关注了我。如果我跟着他们,他们也跟着我,那么我们一定是朋友。否则,这种关系是一种方式。
答案可能对我来说太明显了。我想出了这个,但它似乎比必要的复杂:
me=g.v(_id); me.out('follows').as("following").out('follows').filter{it == me}.back("following")
解决方案是:
me.out('follows').out('follows').retain([me]).back(2)
这说: