0

I'm new neptune and graph dbs and trying to create a simple edge between two vertexs and getting a weird error that I don't fully understand.

const user = await g.V().has('name', 'john').next()
const group = await g.addV("group").property("name", 'johns created group').next()
 const edge = await g.V(user).addE('memberOf').to(g.V(group)).next(); // this line causes error

The third line causes me to get the following error

Error: The child traversal of ... was not spawned anonymously - use the __ class rather than a TraversalSource to construct the child traversal

Any thoughts on what is going on or how to resolve this issue?

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
xeroshogun
  • 1,062
  • 1
  • 18
  • 31

1 Answers1

1

After TinkerPop 3.5.0, you can no longer spawn a child traversal from g. It must be spawned anonymously from __ therefore:

g.V(user).addE('memberOf').to(__.V(group))

More information can be found in the Upgrade Documentation for 3.5.0.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135