Skip to main content
Module

x/typeorm/src/metadata/IndexMetadata.ts>IndexMetadata

Forked from https://github.com/typeorm/typeorm
Latest
class IndexMetadata
import { IndexMetadata } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/metadata/IndexMetadata.ts";

Index metadata contains all information about table's index.

Constructors

new
IndexMetadata(options: { entityMetadata: EntityMetadata; embeddedMetadata?: EmbeddedMetadata; columns?: ColumnMetadata[]; args?: IndexMetadataArgs; })

Properties

columnNamesWithOrderingMap: { [key: string]: number; }

Map of column names with order set. Used only by MongoDB driver.

columns: ColumnMetadata[]

Indexed columns.

optional
embeddedMetadata: EmbeddedMetadata

Embedded metadata if this index was applied on embedded.

entityMetadata: EntityMetadata

Entity metadata of the class to which this index is applied.

optional
expireAfterSeconds: number

Specifies a time to live, in seconds. This option is only supported for mongodb database.

optional
givenColumnNames: ((object?: any) => (any[] | { [key: string]: number; })) | string[]

User specified column names.

optional
givenName: string

User specified index name.

optional
isBackground: boolean

Builds the index in the background so that building an index an does not block other database activities. This option is only supported for mongodb database.

isFulltext: boolean

The FULLTEXT modifier indexes the entire column and does not allow prefixing. Works only in MySQL.

optional
isSparse: boolean

If true, the index only references documents with the specified field. These indexes use less space but behave differently in some situations (particularly sorts). This option is only supported for mongodb database.

isSpatial: boolean

The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values. Works only in MySQL.

isUnique: boolean

Indicates if this index must be unique.

name: string

Final index name. If index name was given by a user then it stores normalized (by naming strategy) givenName. If index name was not given then its generated.

synchronize: boolean

Indicates if this index must synchronize with database index.

optional
target: Function | string

Target class to which metadata is applied.

optional
where: string

Index filter condition.

Methods

build(namingStrategy: NamingStrategyInterface): this

Builds some depend index properties. Must be called after all entity metadata's properties map, columns and relations are built.