CosmosDB: Cannot add a vertex where the partition key property has value 'null'.
devlinse opened this issue · comments
Hi,
I'm sure this is dead simple to solve, but I've got a simple query that creates a vertex in Gremlin that's throwing up the above message. When I've manually added things into Cosmos before, I've had to explicitly include the partition key value, but I don't know how to go about doing that with ExRam?
Thanks
Check out the Gremlinq samples, specifically how a PartitionKey-property is part of the vertex base class and how it's excluded from updates to the vertex.
Hope it helps
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I got this working by specifying the key AND the value in the vertex.
public class Vertex : IVertex
{
public object Id { get; set; }
public string Label { get; set; }
public string pk { get; set; }; // change to match your partition key name
}
then
var marko = await _g
.AddV(new Person { Name = "Marko", Age = 29, pk = "123" })
.FirstAsync();