【问题标题】:How to write Cypher query with gremlin groovy?如何用 gremlin groovy 编写 Cypher 查询?
【发布时间】:2020-04-10 14:02:06
【问题描述】:
MATCH (nginx1111:Service {name:"nginx1111", ip:"1.1.1.1"})
MATCH (host2222:Host {hostname:"host2222", ip:"2.2.2.2"})
MATCH p=(nginx1111)-[*{type:"upstream"}]->(host2222)

如何用 gremlin groovy 编写上述 Cypher 查询?

【问题讨论】:

  • 为了帮助可能有类似问题的其他人,如果您可以添加更精确的标题并添加一些关于您的 Cypher 查询功能的文字,那就太好了。

标签: neo4j cypher gremlin


【解决方案1】:

您想获取 2 个顶点之间的所有路径:

g.V().hasLabel('Service').has('name','nginx1111').has('ip','1.1.1.1')
.repeat(outE().has('type', 'upstream').inV().simplePath())
.until(hasLabel('Host').has('name','host2222').has('ip','2.2.2.2'))
.path()

【讨论】:

    猜你喜欢
    • 2018-09-17
    • 2012-11-29
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多