Azure CosmosDb Gremlin API, Clone vertex, Compilation Error



根据 daniel-luppitz 提供的这个答案,我正在尝试克隆 Azure CosmosDb 中的顶点,但出现以下错误:

编译错误:无法绑定到方法"属性",参数类型为:(图形遍历,图形遍历(

查询:

     IGraphTraversalSource g = coreClient.CreateTraversalSource();
     ITraversal query = g.V(new PartitionKeyIdPair(pk, id)).As("source")
                            .AddV("clone").Property("partitionKey", pk).As("clone")
                            .SideEffect(__.Select<User>("source").Properties<String>().As("p").Select<User>("clone")
.Property(__.Select<object>("p").Key(), __.Select<string>("p").Value<string>()))

如果我更改键和值遍历

.Property(__.Select<object>("p").Key(), __.Select<string>("p").Value<string>()

到常量值,则查询有效

.Property("test", "test")

知道如何在Azure CosmosDb中实现这一目标吗?

我不确定Cosmos DB目前支持哪个TinkerPop版本,但是在浏览了文档之后,我会说它接近3.2.5。3.2 行不支持动态键/值,这是沿着 3.3 行添加的。

因此,在 Cosmos DB 中执行此操作的唯一方法是拆分查询。获取所需的值,然后根据收集的值提交后续查询。显然,这不会表现得很好,可能会大大增加您的使用成本,但我想不出使用旧 Gremlin 版本的另一种方法(考虑到 lambda 是 Cosmos DB 不支持的另一件事(。

最新更新