{
"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 @ref HttpCursor 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/198716636\", \n \"_rev\" : \"198716636\", \n \"_key\" : \"198716636\", \n \"Hello3\" : \"World3\" \n }, \n { \n \"_id\" : \"products/198192348\", \n \"_rev\" : \"198192348\", \n \"_key\" : \"198192348\", \n \"Hello1\" : \"World1\" \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/99888348\", \n \"_rev\" : \"99888348\", \n \"_key\" : \"99888348\", \n \"Hello2\" : \"World2\" \n }, \n { \n \"_id\" : \"products/100412636\", \n \"_rev\" : \"100412636\", \n \"_key\" : \"100412636\", \n \"Hello4\" : \"World4\" \n }, \n { \n \"_id\" : \"products/99429596\", \n \"_rev\" : \"99429596\", \n \"_key\" : \"99429596\", \n \"Hello1\" : \"World1\" \n } \n ], \n \"hasMore\" : true, \n \"id\" : \"100805852\", \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/187837660\", \n \"_rev\" : \"187837660\", \n \"_key\" : \"187837660\", \n \"Hello1\" : \"World1\" \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/236334300\", \n \"_rev\" : \"236334300\", \n \"_key\" : \"236334300\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/236072156\", \n \"_rev\" : \"236072156\", \n \"_key\" : \"236072156\", \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/76360924\", \n \"_rev\" : \"76360924\", \n \"_key\" : \"76360924\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/76623068\", \n \"_rev\" : \"76623068\", \n \"_key\" : \"76623068\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/76229852\", \n \"_rev\" : \"76229852\", \n \"_key\" : \"76229852\", \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/27471068\", \n \"_rev\" : \"27471068\", \n \"_key\" : \"27471068\", \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/27208924\", \n \"_rev\" : \"27208924\", \n \"_key\" : \"27208924\", \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/107031772\", \n \"_rev\" : \"107031772\", \n \"_key\" : \"107031772\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/-0.002/\", \n \"loc\" : [ \n -0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/107293916\", \n \"_rev\" : \"107293916\", \n \"_key\" : \"107293916\", \n \"distance\" : 222.38985328911744, \n \"name\" : \"Name/0.002/\", \n \"loc\" : [ \n 0.002, \n 0 \n ] \n }, \n { \n \"_id\" : \"products/106900700\", \n \"_rev\" : \"106900700\", \n \"_key\" : \"106900700\", \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/138620124\", \n \"_rev\" : \"138620124\", \n \"_key\" : \"138620124\", \n \"text\" : \"this text contains word\" \n }, \n { \n \"_id\" : \"products/138751196\", \n \"_rev\" : \"138751196\", \n \"_key\" : \"138751196\", \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/60239068\", \n \"_rev\" : \"60239068\", \n \"_key\" : \"60239068\", \n \"i\" : 1 \n }, \n { \n \"_id\" : \"products/59780316\", \n \"_rev\" : \"59780316\", \n \"_key\" : \"59780316\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/60370140\", \n \"_rev\" : \"60370140\", \n \"_key\" : \"60370140\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 2, \n \"j\" : 2 \n } \n }, \n { \n \"_id\" : \"products/60042460\", \n \"_rev\" : \"60042460\", \n \"_key\" : \"60042460\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \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/117583068\", \n \"_rev\" : \"117583068\", \n \"_key\" : \"117583068\", \n \"i\" : 1, \n \"a\" : { \n \"j\" : 1 \n } \n }, \n { \n \"_id\" : \"products/117320924\", \n \"_rev\" : \"117320924\", \n \"_key\" : \"117320924\", \n \"i\" : 1, \n \"a\" : { \n \"k\" : 1, \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/115354844\", \n \"_rev\" : \"115354844\", \n \"_key\" : \"115354844\", \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/137178332\", \n \"_rev\" : \"137178332\", \n \"_key\" : \"137178332\", \n \"i\" : 1 \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/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/31337692\", \n \"_rev\" : \"31337692\", \n \"_key\" : \"31337692\", \n \"i\" : 2 \n }, \n { \n \"_id\" : \"products/31468764\", \n \"_rev\" : \"31468764\", \n \"_key\" : \"31468764\", \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