0

In order to get all data from two vertices a and b i used the following

 g.V('xxx').out('hasA')..as('X').out('hasB').as('Y').select('X','Y').

I get values of X where the value of Y isnt null.I wanted to get all X where the value of Y can be or may not be null.

Any ideas as to how i can tweak the above query?

Oliver Towers
  • 445
  • 2
  • 7
sand87
  • 123
  • 1
  • 11

1 Answers1

1

I'm not sure that this matters to you any more but to directly answer your question you need to deal with the chance that there are no "hasB" edges. You might do that with coalesce() in the following fashion:

g.V('xxx').out('hasA').as('X').
  coalesce(out('hasB'),constant('n/a')).as('Y').
  select('X','Y')
stephen mallette
  • 45,298
  • 5
  • 67
  • 135