Options
All
  • Public
  • Public/Protected
  • All
Menu

Module indexes

import type {
  FulltextIndex,
  GeoIndex,
  HashIndex,
  PersistentIndex,
  PrimaryIndex,
  SkiplistIndex,
  TtlIndex,
} from "arangojs/indexes";

The "indexes" module provides index-related types for TypeScript.

Index

Type aliases

EnsureFulltextIndexOptions

EnsureFulltextIndexOptions: { fields: [string]; inBackground?: boolean; minLength?: number; name?: string; type: "fulltext" }

Options for creating a fulltext index.

Type declaration

  • fields: [string]

    An array containing exactly one attribute path.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional minLength?: number

    Minimum character length of words to index.

  • Optional name?: string

    A unique name for this index.

  • type: "fulltext"

    Type of this index.

EnsureGeoIndexOptions

EnsureGeoIndexOptions: { fields: [string, string]; geoJson?: false; inBackground?: boolean; name?: string; type: "geo" } | { fields: [string]; geoJson?: boolean; inBackground?: boolean; name?: string; type: "geo" }

Options for creating a geo index.

EnsureHashIndexOptions

EnsureHashIndexOptions: { deduplicate?: boolean; estimates?: boolean; fields: string[]; inBackground?: boolean; name?: string; sparse?: boolean; type: "hash"; unique?: boolean }

(MMFiles only.) Options for creating a hash index.

When using the RocksDB storage engine, this index type behaves identically to EnsurePersistentIndexOptions.

deprecated

Hash indexes have been deprecated in ArangoDB 3.9 and should be replaced with persistent indexes.

Type declaration

  • Optional deduplicate?: boolean

    If set to false, array values will not be deduplicated.

    Default: true

  • Optional estimates?: boolean

    If set to false, index selectivity estimates will be disabled for this index.

    Default: true

  • fields: string[]

    An array of attribute paths.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional name?: string

    A unique name for this index.

  • Optional sparse?: boolean

    If set to true, the index will omit documents that do not contain at least one of the attribute paths in fields and these documents will be ignored for uniqueness checks.

    Default: false

  • type: "hash"

    Type of this index.

  • Optional unique?: boolean

    If set to true, a unique index will be created.

    Default: false

EnsurePersistentIndexOptions

EnsurePersistentIndexOptions: { estimates?: boolean; fields: string[]; inBackground?: boolean; name?: string; sparse?: boolean; type: "persistent"; unique?: boolean }

Options for creating a persistent index.

Type declaration

  • Optional estimates?: boolean

    If set to false, index selectivity estimates will be disabled for this index.

    Default: true

  • fields: string[]

    An array of attribute paths.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional name?: string

    A unique name for this index.

  • Optional sparse?: boolean

    If set to true, the index will omit documents that do not contain at least one of the attribute paths in fields and these documents will be ignored for uniqueness checks.

    Default: false

  • type: "persistent"

    Type of this index.

  • Optional unique?: boolean

    If set to true, a unique index will be created.

    Default: false

EnsureSkiplistIndexOptions

EnsureSkiplistIndexOptions: { deduplicate?: boolean; estimates?: boolean; fields: string[]; inBackground?: boolean; name?: string; sparse?: boolean; type: "skiplist"; unique?: boolean }

(MMFiles only.) Options for creating a skiplist index.

When using the RocksDB storage engine, this index type behaves identically to EnsurePersistentIndexOptions.

deprecated

Skiplist indexes have been deprecated in ArangoDB 3.9 and should be replaced with persistent indexes.

Type declaration

  • Optional deduplicate?: boolean

    If set to false, array values will not be deduplicated.

    Default: true

  • Optional estimates?: boolean

    If set to false, index selectivity estimates will be disabled for this index.

    Default: true

  • fields: string[]

    An array of attribute paths.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional name?: string

    A unique name for this index.

  • Optional sparse?: boolean

    If set to true, the index will omit documents that do not contain at least one of the attribute paths in fields and these documents will be ignored for uniqueness checks.

    Default: false

  • type: "skiplist"

    Type of this index.

  • Optional unique?: boolean

    If set to true, a unique index will be created.

    Default: false

EnsureTtlIndexOptions

EnsureTtlIndexOptions: { expireAfter: number; fields: [string]; inBackground?: boolean; name?: string; type: "ttl" }

Options for creating a TTL index.

Type declaration

  • expireAfter: number

    Duration in seconds after the attribute value at which the document will be considered as expired.

  • fields: [string]

    An array containing exactly one attribute path.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional name?: string

    A unique name for this index.

  • type: "ttl"

    Type of this index.

EnsureZkdIndexOptions

EnsureZkdIndexOptions: { fieldValueTypes: "double"; fields: string[]; inBackground?: boolean; name?: string; type: "zkd" }

Options for creating a ZKD index.

Type declaration

  • fieldValueTypes: "double"

    Data type of the dimension attributes.

  • fields: string[]

    An array containing attribute paths for the dimensions.

  • Optional inBackground?: boolean

    If set to true, the index will be created in the background to reduce the write-lock duration for the collection during index creation.

    Default: false

  • Optional name?: string

    A unique name for this index.

  • type: "zkd"

    Type of this index.

FulltextIndex

FulltextIndex: GenericIndex & { fields: [string]; minLength: number; type: "fulltext" }

An object representing a fulltext index.

GenericIndex

GenericIndex: { id: string; name?: string; sparse: boolean; unique: boolean }

Shared attributes of all index types.

Type declaration

  • id: string

    A unique identifier for this index.

  • Optional name?: string

    A unique name for this index.

  • sparse: boolean

    Whether documents not containing at least one of the attribute paths are omitted by this index.

  • unique: boolean

    Whether this index enforces uniqueness for values of its attribute paths.

GeoIndex

GeoIndex: GenericIndex & { bestIndexedLevel: number; fields: [string] | [string, string]; geoJson: boolean; maxNumCoverCells: number; type: "geo"; worstIndexedLevel: number }

An object representing a geo index.

HashIndex

HashIndex: GenericIndex & { fields: string[]; selectivityEstimate: number; type: "hash" }

An object representing a hash index.

Index

An object representing an index.

IndexSelector

IndexSelector: ObjectWithId | ObjectWithName | string

Index name, id or object with a name or id property.

ObjectWithId

ObjectWithId: { id: string }

Type declaration

  • [key: string]: any
  • id: string

ObjectWithName

ObjectWithName: { name: string }

Type declaration

  • [key: string]: any
  • name: string

PersistentIndex

PersistentIndex: GenericIndex & { fields: string[]; type: "persistent" }

An object representing a persistent index.

PrimaryIndex

PrimaryIndex: GenericIndex & { fields: string[]; selectivityEstimate: number; type: "primary" }

An object representing a primary index.

SkiplistIndex

SkiplistIndex: GenericIndex & { fields: string[]; type: "skiplist" }

An object representing a skiplist index.

TtlIndex

TtlIndex: GenericIndex & { expireAfter: number; fields: [string]; selectivityEstimate: number; type: "ttl" }

An object representing a TTL index.

ZkdIndex

ZkdIndex: GenericIndex & { fieldValueTypes: "double"; fields: string[]; type: "zkd" }

An object representing a TTL index.

Generated using TypeDoc