Indexes

Create TTL index

Create a hash index.

post/_fabric/{fabric}/_api/index/ttl

Request

Path parameters

fabricstring string required

The name of the fabric.

Query parameters

collectionstring required

The collection name.

Request body

expireAfternumber

The time (in seconds) after a document's creation after which the documents count as "expired".

fieldsstring[]

An array with exactly one attribute path.

typestring required

Must be equal to "ttl".

Example request

{
  "expireAfter": 3600,
  "fields": [
    "_key"
  ],
  "type": "ttl"
}

Response

Successfully fetched existing ttl index.

codeinteger

HTTP response code.

errorboolean

Flag if there is an error in response. False for this response.

fieldsstring[]

HTTP response code.

idstring

Index identifier.

namestring

Name of the index.

selectivityEstimatenumber

The selectivity estimate of index.

sparseboolean

True if index is sparse type.

typestring

Index type.

uniqueboolean

True if index is unique.

expireAfternumber

Index expiry time

Example response

{
  "code": 200,
  "fields": [
    "_key"
  ],
  "id": "61862387",
  "name": "idx_1723573111790501888",
  "selectivityEstimate": 1,
  "type": "ttl",
  "unique": true,
  "expireAfter": 600
}

Changes

No recorded changes to this operation across all 1 revision of this API.