I have the following query to insert two vertices and create an parent edge.
I use g.V('001').repeat(out('parent')).emit().dedup().toList()
to search the parent for node 001.
However, I don't see any property attached to the results. How do I modify the query g.V('001').repeat(out('parent')).emit().dedup().toList()
such that I will see node.name=b
in the resultset?
# insert node 001
g.V("001").hasLabel("mylabel").fold().coalesce(
unfold(),
addV("mylabel").property(T.id, "001").property("name", "a")
).iterate();
# insert node 002
g.V("002").hasLabel("mylabel").fold().coalesce(
unfold(),
addV("mylabel").property(T.id, "002").property("name", "b")
).iterate();
# edge 001 ---(parent)---> 002
g.V("001").hasLabel("mylabel").as("v").V("002").hasLabel("mylabel").coalesce(
__.inE("created").where(outV().as("v")),
addE("parent").from("v")).iterate()
# lookup parent from vertice 001
g.V('001').repeat(out('parent')).emit().dedup().toList()