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 http://sql2gremlin.com/ but only the "AND" operator is given,

My requirement is what is listed below:

SELECT *
  FROM Products
 WHERE Discontinued = 1
   OR UnitsInStock = 0

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

      

Please, help

+3


source to share


1 answer


You can do:

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

      



See or step in GremlinDocs.

+6


source







All Articles