0

Per the Tinkerpop documentation, I would expect the following query to create 1 new vertex with 5 properties when passed to Azure CosmosDB.

g.V()
  .addV('ImpactArea')
  .property('partitionKey', '1')
  .property('docId', 'N3TWjll8Ryba18grxkQD')
  .property('createdAt', '2019-04-30T06:09:43.732259')
  .property('updatedAt', '2019-04-30T06:09:43.732259')
  .property('name', 'Advocacy & Human Rights')

Unexpectedly, this query is creating 4 new vertexes with different id values but with otherwise identical properties (note: id is a cosmos db property and is different from the docId property I am specifying above).

I'm executing this query in the Azure CosmosDB online portal.

Can anyone help me understand why 4 vertexes are being created instead of 1?

John
  • 9,249
  • 5
  • 44
  • 76

1 Answers1

1

Ok, the error was beginning the query with g.V(). The following query works as expected:

g.addV('ImpactArea')
 .property('partitionKey', '1')
 .property('docId', 'N3TWjll8Ryba18grxkQD')
 .property('createdAt', '2019-04-30T06:09:43.732259')
 .property('updatedAt', '2019-04-30T06:09:43.732259')
 .property('name', 'Advocacy & Human Rights')

What I think was happening: my graph has 4 existing vertices in it. g.V() was selecting those 4 vertices and then the addV() portion of the query was being executed for each vertex.

John
  • 9,249
  • 5
  • 44
  • 76