Working with multi-dimensional Indexes

Create multi-dimensional index

creates a multi-dimensional index

POST /_api/index#multi-dim

Query Parameters

  • collection (required): The collection name.

A JSON object with these properties is required:

  • type: must be equal to “zkd”.

  • fields: an array of attribute names used for each dimension. Array expansions are not allowed.

  • unique: if true, then create a unique index.

  • fieldValueTypes: must be equal to “double”. Currently only doubles are supported as values.

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

Return codes

  • 200: If the index already exists, then a HTTP 200 is returned.

  • 201: If the index does not already exist and could be created, then a HTTP 201 is returned.

  • 404: If the collection-name is unknown, then a HTTP 404 is returned.

  • 400: If the index definition is invalid, then a HTTP 400 is returned.

Examples

Creating a multi-dimensional index

shell> curl -X POST --header 'accept: application/json' --data-binary @- --dump - http://localhost:8529/_api/index?collection=intervals <<EOF
{ 
  "type" : "zkd", 
  "fields" : [ 
    "from", 
    "to" 
  ], 
  "fieldValueTypes" : "double" 
}
EOF

HTTP/1.1 201 Created
content-type: application/json
connection: Keep-Alive
content-length: 170
server: ArangoDB
x-content-type-options: nosniff
Show response body