Question

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!

Was it helpful?

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top