azure-cosmosdb - TinkerPop/CosmosDB 中的命令式匹配

标签 azure-cosmosdb graph-databases gremlin tinkerpop3

我想做一个这样的查询

g.V().match(
  as('foo').hasLabel('bar'),
  as('foo').out('baz').hasId('123'),
  as('foo').out('baz').hasId('456')
)
.select('foo').by('id')

这意味着选择 bar 类型的所有节点的 ids,它具有到所有指定节点的 baz 类型的边.

但是,only supports a subset 的 CosmosDB TinkerPop Gremlinmatch() 属于不支持的遍历步骤。

仅使用 supported constructs 来制定上述查询的方法是什么?

最佳答案

你可以这样做

 g.V().hasLabel('bar').as('a').out('baz').hasId(within('123','456')).select('a').id()

在很多情况下,您可以避免使用 match 步骤。

干杯 开尔文

关于azure-cosmosdb - TinkerPop/CosmosDB 中的命令式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50373932/

相关文章:

c# - CosmosDB C# SDK ProyUrl 缺失

Neo4J - 在现有节点上创建关系

neo4j - 我怎么能在neo4j中写这个查询?

gremlin - 有没有办法在 TinkerGraph 上定义模式约束?

mongodb spring 连接一夜之间丢失

sql - 如果值与第二个表匹配,则从一个表中提取值

java - 通过java执行复杂的Titan查询

gremlin - 如何在 gremlin 中返回 true 或 false

neo4j - Neo4J/Cypher 基于项目的协同过滤是否可行?

azure - DocumentDB 连接字符串