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]; minLength?: undefined | number; name?: undefined | string; type: "fulltext" }

Options for creating a fulltext index.

Type declaration

  • fields: [string]

    An array containing exactly one attribute path.

  • Optional minLength?: undefined | number

    The minimum character length of words to index.

  • Optional name?: undefined | string

    A unique name for this index.

  • type: "fulltext"

EnsureGeoIndexOptions

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

Options for creating a geo index.

EnsureHashIndexOptions

EnsureHashIndexOptions: { deduplicate?: undefined | false | true; fields: string[]; name?: undefined | string; sparse?: undefined | false | true; type: "hash"; unique?: undefined | false | true }

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

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

Type declaration

  • Optional deduplicate?: undefined | false | true

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

    Default: true

  • fields: string[]

    An array of attribute paths.

  • Optional name?: undefined | string

    A unique name for this index.

  • Optional sparse?: undefined | false | true

    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"
  • Optional unique?: undefined | false | true

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

    Default: false

EnsurePersistentIndexOptions

EnsurePersistentIndexOptions: { fields: string[]; name?: undefined | string; sparse?: undefined | false | true; type: "persistent"; unique?: undefined | false | true }

Options for creating a persistent index.

Type declaration

  • fields: string[]

    An array of attribute paths.

  • Optional name?: undefined | string

    A unique name for this index.

  • Optional sparse?: undefined | false | true

    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"
  • Optional unique?: undefined | false | true

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

    Default: false

EnsureSkiplistIndexOptions

EnsureSkiplistIndexOptions: { deduplicate?: undefined | false | true; fields: string[]; name?: undefined | string; sparse?: undefined | false | true; type: "skiplist"; unique?: undefined | false | true }

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

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

Type declaration

  • Optional deduplicate?: undefined | false | true

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

    Default: true

  • fields: string[]

    An array of attribute paths.

  • Optional name?: undefined | string

    A unique name for this index.

  • Optional sparse?: undefined | false | true

    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"
  • Optional unique?: undefined | false | true

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

    Default: false

EnsureTtlIndexOptions

EnsureTtlIndexOptions: { expireAfter: number; fields: [string]; name?: undefined | 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 name?: undefined | string

    A unique name for this index.

  • type: "ttl"

FulltextIndex

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

An object representing a fulltext index.

GenericIndex

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

Shared attributes of all index types.

Type declaration

  • id: string

    A unique identifier for this index.

  • Optional name?: undefined | 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.

Generated using TypeDoc