Gremlin: multiple OR filter condition

I want to query my TITAN 0.4 plot based on two filter conditions with "OR" boolean operator (return vertices if any of the conditions is true).

I searched for this on but only the "AND" operator is given,

My requirement is what is listed below:

  FROM Products
 WHERE Discontinued = 1
   OR UnitsInStock = 0

g.V('type','product').has('discontinued', true) "OR"
                     .has('unitsInStock', 0)


Please, help


source to share

1 answer

You can do:

g.V('type','product').or(_().has('discontinued', true), _().has('unitsInStock', 0))


See or step in GremlinDocs.



All Articles