您可以輕鬆地刪除了一堆使用AQL這樣的收藏項目:(就像你在arangosh執行它,這在短期將使用在REST API)
db._query(`FOR item IN test FILTER item._key IN @listToDelete REMOVE item IN test`,
{listToDelete: ['key1', 'key2']})
像我一樣用「_key」屬性必須指定一個屬性,以匹配agains在綁定值的數組。
使用ngrep或wireshark你可以很容易找到HOWTO通過REST接口發送這樣的AQL查詢你自己沒有驅動程序:
POST /_db/_system/_api/cursor HTTP/1.1
Host: 127.0.0.1
Connection: Keep-Alive
User-Agent: ArangoDB
Accept-Encoding: deflate
Authorization: Basic xxxxx
Content-Length: 133
{"query":"FOR item IN test FILTER item._key IN @listToDelete REMOVE item IN test","count":false,"bindVars":{"listToDelete":["840"]}}
T 127.0.0.1:8529 -> 127.0.0.1:39125 [AP]
HTTP/1.1 201 Created
Server: ArangoDB
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
Content-Length: 223
{"result":[],"hasMore":false,"cached":false,"extra":{"stats":{"writesExecuted":0,"writesIgnored":0,"scannedFull":0,"scannedIndex":0,"filtered":0,"executionTime":2.739429473876953e-4},"warnings":[]},"error":false,"code":201}
謝謝你這麼多dothebart ......它的工作:) – mahi