0

Based on this answer provided by daniel-luppitz, I am trying to clone a vertex in Azure CosmosDb but I am getting the following error:

Compilation Error: Unable to bind to method 'property', with arguments of type: (GraphTraversal,GraphTraversal)

The query:

     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>()))

If I change the key and value traversals

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

to constant values then the query works

.Property("test", "test")

Any idea how to achieve this in Azure CosmosDb?

A_Nabelsi
  • 2,524
  • 18
  • 21

1 Answers1

1

I'm not sure which TinkerPop version is currently supported by Cosmos DB, but after skimming through the docs, I would say it's something close to 3.2.5. The 3.2 line did not support dynamic keys/values, that was added somewhere along the 3.3 line.

Thus, the only way to do that in Cosmos DB would be to split the query. Get the values you need and then submit follow-up queries based on the gathered values. Obviously, this won't perform very well will probably increase your usage costs dramatically, but I can't think of another way of doing it using old Gremlin versions (considering that lambdas are another thing that's not supported in Cosmos DB).

Daniel Kuppitz
  • 10,846
  • 1
  • 25
  • 34
  • Thank you @Daniel Kuppits, I am trying to do this in one shot one request to the database. Your suggested solution is my last resort. Thank you very much for support. – A_Nabelsi Jul 28 '19 at 19:29