Arangodb AQL is like NOT IN SQL

How to do FILTER

like this SQL example in AQL?

SELECT * FROM test WHERE option NOT IN ('A', 'B', 'C')

      

+3


source to share


1 answer


In v2.3 and higher you can do:

FOR doc IN test 
  FILTER doc.option NOT IN [ 'A', 'B', 'C' ]
  RETURN doc

      



In earlier versions, the following should work:

FOR doc IN test 
  FILTER ! (doc.option IN [ 'A', 'B', 'C' ])
  RETURN doc

      

+3


source







All Articles