I am relatively new to ArangoDB, and after reading through the docs am trying to implement it for a new project.
I have a collection of documents, and in each document is a list, which contains a number of terms. I am using the java driver, and would like to query for documents whose list matches any of the elements in the list I have.
Example:
Document 1
{
tokens["blue", "red", "green"]
}
Document 2
{
tokens["black", "red", "yellow"]
}
myArrayList:
["purple", "red"]
Since the ArrayList I am trying to query using contains the word "red", I should be presented with both document 1 and document 2. Ideally, I will only be presented with the document ID and the color that matches.
In half-psuedocode from what I know of AQL:
FOR document IN documents FILTER document.tokens CONTAINS myArrayList RETURN document.token.color && document._id
I normally have been returning the whole document object and then just accessing whatever I need. I could do that if it is easier. Eg:
FOR document IN documents FILTER document.tokens CONTAINS myArrayList RETURN document