Gremlin 将自己的帖子包含在跟踪用户的帖子中
我想从用户的跟帖中获取所有帖子以及我自己的帖子,以创建一个新闻提要Gremlin 将自己的帖子包含在跟踪用户的帖子中,gremlin,gremlinpython,Gremlin,Gremlinpython,我想从用户的跟帖中获取所有帖子以及我自己的帖子,以创建一个新闻提要 g.V().has('name', 'Bob').both('is_friend').out('has_posted').as('posts') 上面的代码只返回跟踪用户的帖子 如何包含我自己的帖子?您可以使用union和identity步骤: g.V().has('name', 'Bob').union( both('is_friend'), identity()) .out('has_posted'
g.V().has('name', 'Bob').both('is_friend').out('has_posted').as('posts')
上面的代码只返回跟踪用户的帖子
如何包含我自己的帖子?您可以使用
union
和identity
步骤:
g.V().has('name', 'Bob').union(
both('is_friend'),
identity())
.out('has_posted').as('posts')
您可以看到问题的“实时”示例(只需运行查询)您可以使用
union
和identity
步骤:
g.V().has('name', 'Bob').union(
both('is_friend'),
identity())
.out('has_posted').as('posts')
您可以看到问题的“实时”示例(只需运行查询)