{
"basePath": "/",
"swaggerVersion": "1.1",
"apiVersion": "0.1",
"apis": [
{
"operations": [
{
"errorResponses": [
{
"reason": "is returned if the return set contains at least one document and waitForSync was true. ",
"code": "201"
},
{
"reason": "is returned if the body does not contain a valid JSON representation of a document. The response body contains an error document in this case. ",
"code": "400"
},
{
"reason": "is returned if the collection specified by collection is unknown. The response body contains an error document in this case. ",
"code": "404"
}
],
"parameters": [
{
"dataType": "String",
"paramType": "body",
"required": "true",
"name": "query",
"description": "Contains the query. "
}
],
"notes": "
Returns all documents of a collections. The call expects a JSON object as body with the following attributes:
- collection: The name of the collection to query.
- skip: The number of documents to skip in the query (optional).
- limit: The maximal amount of documents to return. The skip is applied before the limit restriction. (optional)
Returns a cursor containing the result, see the manual for details.
",
"summary": "executes simple query ALL",
"httpMethod": "PUT",
"examples": "Limit the amount of documents using limit
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"skip\": 2, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/221004199\", \n \"_rev\" : \"221004199\", \n \"_key\" : \"221004199\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/221331879\", \n \"_rev\" : \"221331879\", \n \"_key\" : \"221331879\", \n \"Hello4\" : \"World4\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/all\n{ \"collection\": \"products\", \"batchSize\" : 3 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/223494567\", \n \"_rev\" : \"223494567\", \n \"_key\" : \"223494567\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/222773671\", \n \"_rev\" : \"222773671\", \n \"_key\" : \"222773671\", \n \"Hello1\" : \"World1\" \n }, \n { \n \"_id\" : \"products/223166887\", \n \"_rev\" : \"223166887\", \n \"_key\" : \"223166887\", \n \"Hello2\" : \"World2\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"224346535\", \n \"count\" : 5, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/any\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/226640295\", \n \"_rev\" : \"226640295\", \n \"_key\" : \"226640295\", \n \"Hello5\" : \"World5\" \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/229130663\", \n \"_rev\" : \"229130663\", \n \"_key\" : \"229130663\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/228737447\", \n \"_rev\" : \"228737447\", \n \"_key\" : \"228737447\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/232145319\", \n \"_rev\" : \"232145319\", \n \"_key\" : \"232145319\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/232538535\", \n \"_rev\" : \"232538535\", \n \"_key\" : \"232538535\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/231948711\", \n \"_rev\" : \"231948711\", \n \"_key\" : \"231948711\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 2, \"radius\" : 500 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/235946407\", \n \"_rev\" : \"235946407\", \n \"_key\" : \"235946407\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/235553191\", \n \"_rev\" : \"235553191\", \n \"_key\" : \"235553191\", \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/near\n{ \"collection\": \"products\", \"latitude\" : 0, \"longitude\" : 0, \"skip\" : 1, \"limit\" : 3, \"distance\" : \"distance\", \"radius\" : 300 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/238961063\", \n \"_rev\" : \"238961063\", \n \"_key\" : \"238961063\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/239354279\", \n \"_rev\" : \"239354279\", \n \"_key\" : \"239354279\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/238764455\", \n \"_rev\" : \"238764455\", \n \"_key\" : \"238764455\", \n \"distance\" : 444.779706578235, \n \"name\" : \"Name/-0.004/\", \n \"loc\" : [ \n -0.004, \n 0 \n ] \n } \n ], \n \"hasMore\" : false, \n \"count\" : 3, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/241320359\", \n \"_rev\" : \"241320359\", \n \"_key\" : \"241320359\", \n \"text\" : \"this text contains word\" \n }, \n { \n \"_id\" : \"products/241582503\", \n \"_rev\" : \"241582503\", \n \"_key\" : \"241582503\", \n \"text\" : \"this text also has a word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/243745191\", \n \"_rev\" : \"243745191\", \n \"_key\" : \"243745191\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/243351975\", \n \"_rev\" : \"243351975\", \n \"_key\" : \"243351975\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/244203943\", \n \"_rev\" : \"244203943\", \n \"_key\" : \"244203943\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/244007335\", \n \"_rev\" : \"244007335\", \n \"_key\" : \"244007335\", \n \"i\" : 1 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 4, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a.j\" : 1 } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/245711271\", \n \"_rev\" : \"245711271\", \n \"_key\" : \"245711271\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/246104487\", \n \"_rev\" : \"246104487\", \n \"_key\" : \"246104487\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/248463783\", \n \"_rev\" : \"248463783\", \n \"_key\" : \"248463783\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"hasMore\" : false, \n \"count\" : 1, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"i\" : 1 } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"document\" : { \n \"_id\" : \"products/250823079\", \n \"_rev\" : \"250823079\", \n \"_key\" : \"250823079\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first-example\n{ \"collection\": \"products\", \"example\" : { \"l\" : 1 } }\n\nHTTP/1.1 404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 404, \n \"errorNum\" : 404, \n \"errorMessage\" : \"no match\" \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/255082919\", \n \"_rev\" : \"255082919\", \n \"_key\" : \"255082919\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/255476135\", \n \"_rev\" : \"255476135\", \n \"_key\" : \"255476135\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/first\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/257245607\", \n \"_rev\" : \"257245607\", \n \"_key\" : \"257245607\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\", \"count\" : 2 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/260260263\", \n \"_rev\" : \"260260263\", \n \"_key\" : \"260260263\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/260063655\", \n \"_rev\" : \"260063655\", \n \"_key\" : \"260063655\", \n \"i\" : 1 \n } \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/last\n{ \"collection\": \"products\" }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : { \n \"_id\" : \"products/262422951\", \n \"_rev\" : \"262422951\", \n \"_key\" : \"262422951\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/range\n{ \"collection\": \"products\", \"attribute\" : \"i\", \"left\" : 2, \"right\" : 4 }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/263864743\", \n \"_rev\" : \"263864743\", \n \"_key\" : \"263864743\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/264061351\", \n \"_rev\" : \"264061351\", \n \"_key\" : \"264061351\", \n \"i\" : 3 \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/remove-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } } }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"deleted\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/replace-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : {\"foo\" : \"bar\"}, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"replaced\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n
unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/update-by-example\n{ \"collection\": \"products\", \"example\" : { \"a\" : { \"j\" : 1 } }, \"newValue\" : { \"a\" : { \"j\" : 22 } }, \"limit\" : 3 }\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"updated\" : 1, \n \"error\" : false, \n \"code\" : 200 \n}\n\n