ArangoDB AQL Non Case Sensitive Comparison

aql, arangodb, case-sensitive

Solution

There is a `LOWER` string function in AQL which you can try to use in your query like this:

FOR a IN animals
    FILTER LOWER(a.quality) == 'fuzzy'
    RETURN a

Problem

Let's imagine I have a few simple docs stored in an Arango collection like so: ``` [ {"type":Cat, "quality":Fuzzy} {"type":Dog, "quality":Barks} {"type":Rabbit, "quality":Hoppy} {"type":Pig, "quality":Chubby} {"type":Red Panda, "quality":Fuzzy} {"type":Monkey, "quality":Hairy} ] ``` Now let's say a user initiates a search in my application for all animals that are 'fuzzy', all lower case. Is there a way with AQL to make a comparison that is not case sensitive? So for instance: ``` FOR a IN animals FILTER a.type.toLowerCase() == fuzzy RETURN a ``` Now I know the above example doesn't work, but it would be nice if there was a way to do this. Thanks!

Original source