{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the result set can be created by the server.
",
"code": "201"
},
{
"reason": "is returned if the JSON representation is malformed or the query specification is missing from the request.
",
"code": "400"
},
{
"reason": "The server will respond with HTTP 404 in case a non-existing collection is accessed in the query.
",
"code": "404"
},
{
"reason": "The server will respond with HTTP 405 if an unsupported HTTP method is used.
",
"code": "405"
}
],
"parameters": [
{
"dataType": "Json",
"paramType": "body",
"required": "true",
"name": "query",
"description": "A JSON object describing the query and query parameters.
"
}
],
"notes": "The query details include the query string plus optional query options and bind parameters. These values need to be passed in a JSON representation in the body of the POST request.
The following attributes can be used inside the JSON object:
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 2 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/917195309\", \n \"_key\" : \"917195309\", \n \"_rev\" : \"917195309\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/917522989\", \n \"_key\" : \"917522989\", \n \"_rev\" : \"917522989\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 2, \n \"scannedIndex\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/918112813\", \n \"_key\" : \"918112813\", \n \"_rev\" : \"918112813\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/918768173\", \n \"_key\" : \"918768173\", \n \"_rev\" : \"918768173\", \n \"hello3\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"919620141\", \n \"count\" : 5, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 5, \n \"scannedIndex\" : 0 \n } \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR i IN 1..1000 FILTER i > 500 LIMIT 10 RETURN i\",\"count\":true,\"options\":{\"fullCount\":true}}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n 501, \n 502, \n 503, \n 504, \n 505, \n 506, \n 507, \n 508, \n 509, \n 510 \n ], \n \"hasMore\" : false, \n \"count\" : 10, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0, \n \"fullCount\" : 500 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR i IN 1..10 LET a = 1 LET b = 2 FILTER a + b == 3 RETURN i\",\"count\":true,\"options\":{\"maxPlans\":1,\"optimizer\":{\"rules\":[\"-all\",\"+remove-unnecessary-filters\"]}}}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n 1, \n 2, \n 3, \n 4, \n 5, \n 6, \n 7, \n 8, \n 9, \n 10 \n ], \n \"hasMore\" : false, \n \"count\" : 10, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products REMOVE p IN products\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 2, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 2, \n \"scannedIndex\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"REMOVE 'bar' IN products OPTIONS { ignoreErrors: true }\"}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ ], \n \"hasMore\" : false, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 1, \n \"scannedFull\" : 0, \n \"scannedIndex\" : 0 \n }, \n \"warnings\" : [ ] \n }, \n \"error\" : false, \n \"code\" : 201 \n}\n
shell> curl -X POST --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1502, \n \"errorMessage\" : \"query is empty\" \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR u IN unknowncoll LIMIT 2 RETURN u\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1203, \n \"errorMessage\" : \"collection not found (unknowncoll)\" \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"REMOVE 'foo' IN products\"}\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1202, \n \"errorMessage\" : \"document not found (while executing)\" \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nshell> curl -X PUT --dump - http://localhost:8529/_api/cursor/924207661\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/924011053\", \n \"_key\" : \"924011053\", \n \"_rev\" : \"924011053\", \n \"hello5\" : \"world1\" \n }, \n { \n \"_id\" : \"products/923028013\", \n \"_key\" : \"923028013\", \n \"_rev\" : \"923028013\", \n \"hello2\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"924207661\", \n \"count\" : 5, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 5, \n \"scannedIndex\" : 0 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"bad parameter\" \n}\n
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 1600, \n \"errorMessage\" : \"cursor not found\" \n}\n
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor\n{\"query\":\"FOR p IN products LIMIT 5 RETURN p\",\"count\":true,\"batchSize\":2}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/924666413\", \n \"_key\" : \"924666413\", \n \"_rev\" : \"924666413\", \n \"hello1\" : \"world1\" \n }, \n { \n \"_id\" : \"products/925649453\", \n \"_key\" : \"925649453\", \n \"_rev\" : \"925649453\", \n \"hello4\" : \"world1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"926173741\", \n \"count\" : 5, \n \"extra\" : { \n \"stats\" : { \n \"writesExecuted\" : 0, \n \"writesIgnored\" : 0, \n \"scannedFull\" : 5, \n \"scannedIndex\" : 0 \n } \n }, \n \"error\" : false, \n \"code\" : 201 \n}\nshell> curl -X DELETE --data-binary @- --dump - http://localhost:8529/_api/cursor/926173741\n\n