I have a Vertex upsert working and an Edge upsert working in 2 separate traversals. Is it possible to combine the 2 into 1 traversal? I have attempted but am receiving errors.
a = self.g.V().has('account', 'id', 'account-111111111').fold().coalesce(.unfold(),.addV('account').property(T.id, 'account-111111111')).has('customer', 'id', 'cust-111111111').as_('v').V().has('account', 'id', 'account-111111111').coalesce(.inE('owns').where(.outV().as_('v')),.addE('owns').from_(.V('customer', 'id', 'cust-111111111')))
a.next()
Works:
Vertex Upsert:
a = g.V().has('account', 'id', 'account-111111111').fold().coalesce(.unfold(),.addV('account').property(T.id, 'account-111111111')) a.next()
Edge Upsert:
a = g.V().has('customer', 'id', 'cust-111111111').as_('v').V().has('account', 'id', 'account-111111111). \ coalesce(.inE('owns').where(.outV().as_('v')),.addE('owns').from_(.V('customer', 'id', 'cust-111111111])))
a.next()