4
許多(所有?)ArangoDB的圖形函數接受一個「示例」文檔。對於例如參數的文件說:ArangoDB示例:用x的鍵匹配任何東西?
{} : 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),看來我既提供密鑰和阿朗戈來匹配的值。
有沒有辦法讓我創建一個匹配任何具有特定鍵的文檔的示例(只要該值不爲空)?
爲了方便說明,在這裏我想獲得的是有「演員」的關鍵任何相鄰頂點和我不在乎什麼鍵的值(只要它有一個):
db._query('RETURN GRAPH_NEIGHBORS("movies", {movie: "Scarfies"}, {neighborExamples: [{actor: *}]})').toArray()
這是可能在ArangoDB?
謝謝。我爲此打開了問題[1241](https://github.com/arangodb/arangodb/issues/1241)。 – mikewilliamson 2015-02-11 15:32:07