{ "basePath": "/", "swaggerVersion": "1.1", "apiVersion": "0.1", "apis": [ { "operations": [ { "errorResponses": [], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection", "description": "The collection name.

" } ], "notes": "

Returns an object with an attribute indexes containing a list of all index descriptions for the given collection. The same information is also available in the identifiers as hash map with the index handle as keys.

", "summary": " Read all indexes of a collection", "httpMethod": "GET", "examples": "

Return information about all indexes:



shell> curl --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"indexes\" : [ \n    { \n      \"id\" : \"products/0\", \n      \"type\" : \"primary\", \n      \"unique\" : true, \n      \"fields\" : [ \n        \"_key\" \n      ] \n    } \n  ], \n  \"identifiers\" : { \n    \"products/0\" : { \n      \"id\" : \"products/0\", \n      \"type\" : \"primary\", \n      \"unique\" : true, \n      \"fields\" : [ \n        \"_key\" \n      ] \n    } \n  }, \n  \"error\" : false, \n  \"code\" : 200 \n}\n



", "nickname": "ReadAllIndexesOfACollection" } ], "path": "/_api/index" }, { "operations": [ { "errorResponses": [ { "reason": "If the index exists, then a HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not exist, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "path", "required": "true", "name": "index-handle", "description": "The index-handle.

" } ], "notes": "

The result is an objects describing the index. It has at least the following attributes:

All other attributes are type-dependent.

", "summary": "Read index", "httpMethod": "GET", "examples": "



shell> curl --data-binary @- --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/0\", \n  \"type\" : \"primary\", \n  \"unique\" : true, \n  \"fields\" : [ \n    \"_key\" \n  ], \n  \"error\" : false, \n  \"code\" : 200 \n}\n



", "nickname": "ReadIndex" } ], "path": "/_api/index/{index-handle}" }, { "operations": [ { "errorResponses": [ { "reason": "If the index already exists, then an HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not already exist and could be created, then an HTTP 201 is returned.

", "code": "201" }, { "reason": "If either size or byteSize contain invalid values, then an HTTP 400 is returned.

", "code": "400" }, { "reason": "If the collection-name is unknown, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection", "description": "The collection name.

" }, { "dataType": "Json", "paramType": "body", "required": "true", "name": "cap-constraint", "description": "

" } ], "notes": "

Creates a cap constraint for the collection collection-name, if it does not already exist. Expects an object containing the index details.

Note: The cap constraint does not index particular attributes of the documents in a collection, but limits the number of documents in the collection to a maximum value. The cap constraint thus does not support attribute names specified in the fields attribute nor uniqueness of any kind via the unique attribute.

It is allowed to specify either size or byteSize, or both at the same time. If both are specified, then the automatic document removal will be triggered by the first non-met constraint.

", "summary": " Create cap constraint", "httpMethod": "POST", "examples": "

Creating a cap constraint



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{\"type\":\"cap\",\"size\":10}\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1138490536\", \n  \"type\" : \"cap\", \n  \"unique\" : false, \n  \"size\" : 10, \n  \"byteSize\" : 0, \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



", "nickname": "CreateCapConstraint" } ], "path": "/_api/index" }, { "operations": [ { "errorResponses": [ { "reason": "If the index already exists, then a HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not already exist and could be created, then a HTTP 201 is returned.

", "code": "201" }, { "reason": "If the collection-name is unknown, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection", "description": "The collection name.

" }, { "dataType": "Json", "paramType": "body", "required": "true", "name": "index-details", "description": "

" } ], "notes": "

Creates a geo-spatial index in the collection collection-name, if it does not already exist. Expects an object containing the index details.

Note: Unique indexes on non-shard keys are not supported in a cluster.

", "summary": " Create geo-spatial index", "httpMethod": "POST", "examples": "

Creating a geo index with a location attribute:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1139014824\", \n  \"type\" : \"geo1\", \n  \"unique\" : false, \n  \"geoJson\" : false, \n  \"constraint\" : false, \n  \"ignoreNull\" : false, \n  \"fields\" : [ \n    \"b\" \n  ], \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



Creating a geo index with latitude and longitude attributes:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"geo\", \"fields\" : [ \"e\", \"f\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1139539112\", \n  \"type\" : \"geo2\", \n  \"unique\" : false, \n  \"constraint\" : false, \n  \"ignoreNull\" : false, \n  \"fields\" : [ \n    \"e\", \n    \"f\" \n  ], \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



", "nickname": "CreateGeo-spatialIndex" } ], "path": "/_api/index" }, { "operations": [ { "errorResponses": [ { "reason": "If the index already exists, then a HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not already exist and could be created, then a HTTP 201 is returned.

", "code": "201" }, { "reason": "If the collection already contains documents and you try to create a unique hash index in such a way that there are documents violating the uniqueness, then a HTTP 400 is returned.

", "code": "400" }, { "reason": "If the collection-name is unknown, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection-name", "description": "The collection name.

" }, { "dataType": "Json", "paramType": "body", "required": "true", "name": "index-details", "description": "

" } ], "notes": "

Creates a hash index for the collection collection-name, if it does not already exist. The call expects an object containing the index details.

Note: unique indexes on non-shard keys are not supported in a cluster.

", "summary": " Create hash index", "httpMethod": "POST", "examples": "

Creating an unique constraint:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : true, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1140063400\", \n  \"type\" : \"hash\", \n  \"unique\" : true, \n  \"fields\" : [ \n    \"a\", \n    \"b\" \n  ], \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



Creating a hash index:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"hash\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1140587688\", \n  \"type\" : \"hash\", \n  \"unique\" : false, \n  \"fields\" : [ \n    \"a\", \n    \"b\" \n  ], \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



", "nickname": "CreateHashIndex" } ], "path": "/_api/index" }, { "operations": [ { "errorResponses": [ { "reason": "If the index already exists, then a HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not already exist and could be created, then a HTTP 201 is returned.

", "code": "201" }, { "reason": "If the collection already contains documents and you try to create a unique skip-list index in such a way that there are documents violating the uniqueness, then a HTTP 400 is returned.

", "code": "400" }, { "reason": "If the collection-name is unknown, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection-name", "description": "The collection name.

" }, { "dataType": "Json", "paramType": "body", "required": "true", "name": "index-details", "description": "

" } ], "notes": "

Creates a skip-list index for the collection collection-name, if it does not already exist. The call expects an object containing the index details.

Note: unique indexes on non-shard keys are not supported in a cluster.

", "summary": " Create skip list", "httpMethod": "POST", "examples": "

Creating a skiplist:



shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/index?collection=products\n{ \"type\": \"skiplist\", \"unique\" : false, \"fields\" : [ \"a\", \"b\" ] }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n  \"id\" : \"products/1141111976\", \n  \"type\" : \"skiplist\", \n  \"unique\" : false, \n  \"fields\" : [ \n    \"a\", \n    \"b\" \n  ], \n  \"isNewlyCreated\" : true, \n  \"error\" : false, \n  \"code\" : 201 \n}\n



", "nickname": "CreateSkipList" } ], "path": "/_api/index" }, { "operations": [ { "errorResponses": [ { "reason": "If the index already exists, then a HTTP 200 is returned.

", "code": "200" }, { "reason": "If the index does not already exist and could be created, then a HTTP 201 is returned.

", "code": "201" }, { "reason": "If the collection-name is unknown, then a HTTP 404 is returned.

", "code": "404" } ], "parameters": [ { "dataType": "String", "paramType": "query", "required": "true", "name": "collection-name", "description": "The collection name.

" }, { "dataType": "Json", "paramType": "body", "required": "true", "name": "index-details", "description": "

" } ], "notes": "

Creates a fulltext index for the collection collection-name, if it does not already exist. The call expects an object containing the index details.