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!
The ArangoDB Query Language (AQL) is similar to the Structured Query Language (SQL) in its purpose. Both support reading and modifying collection data, however AQL does not support data definition operations, such as creating and dropping databases, collections and indexes.
The LET statement can be used to assign an arbitrary value to a variable.
Single line comments: These start with a double forward slash and end at the end of the line, or the end of the query string (whichever is first).
“Identity” analyzer does nothing but treats input value as an atom, so no transformation is applied.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With