ArangoDB 的许多(全部?)图形函数都接受“示例”文档。示例参数的文档说:
{} : 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
在每种情况下(idString 除外),我似乎都为 Arango 提供了一个键和一个值来匹配。
有没有办法让我创建一个匹配任何具有特定键的文档的示例(只要值不为空)?
只是为了说明,在这里我想获取任何具有“actor”键的相邻顶点,我不在乎该键的值是什么(只要它有一个):
db._query('RETURN GRAPH_NEIGHBORS("movies", {movie: "Scarfies"}, {neighborExamples: [{actor: *}]})').toArray()
这在 ArangoDB 中可行吗?