Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IndexOptions

Options used to configure index.

Hierarchy

  • IndexOptions

Index

Constructors

constructor

  • Returns IndexOptions

  • Parameters

    Returns IndexOptions

Methods

getBits

  • getBits(): number
  • Gets the number of precision of the stored geohash value of the location data in 2d indexes.

    Returns number

getBucketSize

  • getBucketSize(): number
  • Gets the specified the number of units within which to group the location values for geoHaystack Indexes

    Returns number

getCollation

  • Optional. Specifies the collation for the index.

    Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.

    If you have specified a collation at the collection level, then: If you do not specify a collation when creating the index, MongoDB creates the index with the collection's default collation. If you do specify a collation when creating the index, MongoDB creates the index with the specified collation. When specifying collation, the locale field is mandatory; all other collation fields are optional. For descriptions of the fields, see Collation Document.

    Returns CollationOptions

getDefaultLanguage

  • getDefaultLanguage(): string
  • Gets the language for a text index.

    The language that determines the list of stop words and the rules for the stemmer and tokenizer.

    Returns string

getLanguageOverride

  • getLanguageOverride(): string
  • Gets the name of the field that contains the language string.

    For text indexes, the name of the field, in the collection's documents, that contains the override language for the document.

    Returns string

getMax

  • getMax(): number
  • Gets the upper inclusive boundary for the longitude and latitude values for 2d indexes..

    Returns number

getMin

  • getMin(): number
  • Gets the lower inclusive boundary for the longitude and latitude values for 2d indexes..

    Returns number

getName

  • getName(): string
  • Gets the name of the index.

    Returns string

getPartialFilterExpression

  • getPartialFilterExpression(): {}
  • Get the filter expression for the documents to be included in the index or null if not set

    Returns {}

    • [key: string]: any

getSphereVersion

  • getSphereVersion(): number
  • Gets the 2dsphere index version number.

    Returns number

getStorageEngine

  • getStorageEngine(): {}
  • Gets the storage engine options document for this index.

    Returns {}

    • [key: string]: any

getTextVersion

  • getTextVersion(): number
  • The text index version number.

    Returns number

getVersion

  • getVersion(): number
  • Gets the index version number.

    Returns number

getWeights

  • getWeights(): {}
  • Gets the weighting object for use with a text index

    A document that represents field and weight pairs. The weight is an integer ranging from 1 to 99,999 and denotes the significance of the field relative to the other indexed fields in terms of the score.

    Returns {}

    • [key: string]: any

isBackground

  • isBackground(): boolean
  • Create the index in the background

    Returns boolean

isSparse

  • isSparse(): boolean
  • If true, the index only references documents with the specified field

    Returns boolean

isUnique

  • isUnique(): boolean
  • Gets if the index should be unique.

    Returns boolean

setCollation

  • Optional. Specifies the collation for the index.

    Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.

    If you have specified a collation at the collection level, then: If you do not specify a collation when creating the index, MongoDB creates the index with the collection's default collation. If you do specify a collation when creating the index, MongoDB creates the index with the specified collation. When specifying collation, the locale field is mandatory; all other collation fields are optional. For descriptions of the fields, see Collation Document.

    Parameters

    Returns IndexOptions

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc