magicaltrout
magicaltrout

Reputation: 504

Adding Edge to Janusgraph via Gremlin interface

Can anyone explain why this doesn't seem to do anything

ve = g.addV("test").as("m").iterate()
g.addV("test2").as("q").V(ve).addE("contains").from("q").iterate()
g.V().hasLabel("test2").outE().otherV().path()

The operation executes without error but then doesn't return anything when asking for the edges.

I know I could join the traversals together, but I'm specifically looking at a usecase where I'd create the first vertex in a slightly different block of code.

Upvotes: 0

Views: 1021

Answers (1)

magicaltrout
magicaltrout

Reputation: 504

Got it:

ve = g.addV("test").as("m").iterate()

should be

ve = g.addV("test").as("m").next()

Upvotes: 1

Related Questions