Starting from the Azure Cosmos DB Graph API example: https://github.com/Azure-Samples/azure-cosmos-db-graph-gremlindotnet-getting-started
I am interested in using Gremlin.NET (the example uses version 3.2.7) to execute queries using the C# classes instead of writing string queries and execute them using the gremlinClient.SubmitAsync<dynamic>("...")
method.
But when I execute the following code I'm getting a
NullReferenceException at Gremlin.Net.Driver.Connection.d__14`1.MoveNext()
when calling .Next()
var gremlinServer = new GremlinServer(hostname, port, enableSsl: true,
username: "/dbs/" + database + "/colls/" + collection,
password: authKey);
var graph = new Graph();
var g = graph.Traversal().WithRemote(new DriverRemoteConnection(new GremlinClient(gremlinServer)));
var vertex = g.V().HasLabel("person").Next();
Console.WriteLine(vertex);
Unfortunately I haven't found any documentation on how to use Gremlin.NET it would be nice if someone of you can point me to some "getting started".
Edit: The query result from the Azure Cosmos DB Data Explorer looks like the following:
[
{
"id": "thomas",
"label": "person",
"type": "vertex",
"properties": {
"firstName": [
{
"id": "9015b584-375f-4005-af00-f49d6e2d6b94",
"value": "Thomas"
}
],
"age": [
{
"id": "c2300d19-12a0-474a-9405-eb89466bcbb3",
"value": 44
}
]
},
"_isRoot": true,
"_isFixedPosition": true
}
]