Is it possible to use AQL query language via REST API to make graph queries?
Thanks.
Great! But this AQL bellow works fine in the AQL editor, but not it the REST.
curl -X POST --dump - http://localhost:8529/_db/database/_api/cursor --data '{query:LET from = (FOR p IN products FILTER p.name == "p1" RETURN p._id) LET to=(FOR p IN products FILTER p.name == "p2" RETURN p._id) INSERT { _from: from[0], _to: to[0], type: "RELATED" } INTO productsedge}' HTTP/1.1 400 Bad Request Server: ArangoDB Connection: Keep-Alive Content-Type: application/json; charset=utf-8 Content-Length: 82 {"error":true,"errorMessage":"expecting attribute name","code":400,"errorNum":600}
Yes, HTTP Query cursor API is the right API to do this. It allows executing AQL queries via HTTP.
Example (with a non-graph query):
You can put your AQL query string (using graph functions) into the
query
attribute of the request. Bind parameters are optional. If used, they can be put into the optionalbindVars
attribute of the request: