-1

Steps in the code: 1.Declared Azure Cosmos DB Configuration variables(Host , PrimaryKey , Database ,Container) 2.Connection Pool 3.WebSocketConfiguration 4.GremlinServer

After all above steps, when I was using gremlin client and trying to add vertices getting below exception: using (var gremlinClient = new GremlinClient( gremlinServer, connectionPoolSettings: connectionPoolSettings, webSocketConfiguration: webSocketConfiguration)) {

          var g = Traversal().WithRemote(new DriverRemoteConnection(gremlinClient));
            var v1 = g.AddV("person").Property("name", "marko");
            var v2 = g.AddV("person").Property("name", "stephen");
            **g.AddV("Person").AddE("self").To(g.V(1));**

}

EXCEPTION : System.ArgumentException: 'The child traversal of Gremlin.Net.Process.Traversal.Bytecode was not spawned anonymously - use the __ class rather than a TraversalSource to construct the child traversal'

1 Answers1

1

Instead of using to(g.V(1)) just use to(V(1)) or to(__.V(1)) .

The use of a g mid traversal was deprecated in the 3.5.x line of Apache TinkerPop and removed as part of the 3.6.0 launch.

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
  • Thanks for your response we are using gremlin.net library(with .net core 6) , Where g is reference (obj) var g = Traversal().WithRemote(new DriverRemoteConnection(gremlinClient)); Also I am getting closed connection at server side , Below is the separate post, Could you please share your valuable inputs https://stackoverflow.com/questions/73682384/gremlin-net-driver-exceptions-connectionclosedexception Thanks for your support. – place holder Sep 12 '22 at 03:20
  • I will take a look. Did my answer resolve the issue described in this question? If, yes, I would appreciate it if you accept the answer. That way others that find the question will know it has an accepted answer. – Kelvin Lawrence Sep 12 '22 at 12:24
  • Thanks for your efforts @Kelvin Lawrence. Actually g is reference in .Net so if I don't use reference of g , it will throw compile time error. – place holder Sep 12 '22 at 17:52
  • You should not need to use `g` inside a `V` using the Gremlin .Net client – Kelvin Lawrence Sep 13 '22 at 01:27