ArangoDB v3.11 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent stable version.

HTTP interface for multi-dimensional indexes

Create a multi-dimensional index

POST /_db/{database-name}/_api/index
Creates a multi-dimensional index for the collection collection-name, if it does not already exist.
Path Parameters
  • The name of the database.

Query Parameters
  • The collection name.

HTTP Headers
    Request Body application/json object
    • Must be equal to "double". Currently only doubles are supported as values.

    • An array of attribute names used for each dimension. Array expansions are not allowed.

    • Set this option to true to keep the collection/shards available for write operations by not using an exclusive write lock for the duration of the index creation.

    • An easy-to-remember name for the index to look it up or refer to it in index hints. Index names are subject to the same character restrictions as collection names. If omitted, a name is auto-generated so that it is unique with respect to the collection, e.g. idx_832910498.

    • Must be equal to "zkd".

    • if true, then create a unique index.

    Responses
    • The index exists already.

    • The index is created as there is no such existing index.

    • The index definition is invalid.

    • The collection is unknown.

    Examples

    Creating a multi-dimensional index

    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
    Show output
    HTTP/1.1 201 Created
    content-type: application/json
    cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0
    connection: Keep-Alive
    content-length: 197
    content-security-policy: frame-ancestors 'self'; form-action 'self';
    expires: 0
    pragma: no-cache
    server: ArangoDB
    strict-transport-security: max-age=31536000 ; includeSubDomains
    x-arango-queue-time-seconds: 0.000000
    x-content-type-options: nosniff
    
    { 
      "fieldValueTypes" : "double", 
      "fields" : [ 
        "from", 
        "to" 
      ], 
      "id" : "intervals/72037", 
      "isNewlyCreated" : true, 
      "name" : "idx_1832936199150370816", 
      "sparse" : false, 
      "type" : "zkd", 
      "unique" : false, 
      "code" : 201, 
      "error" : false 
    }