Many (all?) Functions of the ArangoDB graph accept a "sample" document. The documentation for the example parameter states:
{} : Returns all possible vertices for this graph
idString : Returns the vertex/edge with the id idString
[idString1, idString2 ...] : Returns the vertices/edges with the ids matching the given strings.
{key1 : value1, key2 : value2} : Returns the vertices/edges that match this example, which means that both have key1 and key2 with the corresponding attributes
{key1.key2 : value1, key3 : value2} : It is possible to chain keys, which means that a document {key1 : {key2 : value1}, key3 : value2} would be a match
[{key1 : value1}, {key2 : value2}] : Returns the vertices/edges that match one of the examples, which means that either key1 or key2 are set with the corresponding value
In each of these cases (except for idString) it seems that I am providing both a key and a value for Arango matching.
Is there a way to create an example that will match any document with a specific key (if the value is not null)?
Just to illustrate, here I would like to get any neighboring vertex with the "actor" key, and I do not care what the value of this key (if any) is:
db._query('RETURN GRAPH_NEIGHBORS("movies", {movie: "Scarfies"}, {neighborExamples: [{actor: *}]})').toArray()
Is this possible in ArangoDB?
source
share