API 参考
    正在准备搜索索引...

    Describes all index options.

    interface IndexOptions {
        background?: boolean;
        concurrent?: boolean;
        expireAfterSeconds?: number;
        fulltext?: boolean;
        nullFiltered?: boolean;
        parser?: string;
        sparse?: boolean;
        spatial?: boolean;
        unique?: boolean;
        where?: string;
    }
    索引

    属性

    background?: 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.

    concurrent?: boolean

    Create the index using the CONCURRENTLY modifier Works only in postgres.

    expireAfterSeconds?: number

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

    fulltext?: boolean

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

    nullFiltered?: boolean

    NULL_FILTERED indexes are particularly useful for indexing sparse columns, where most rows contain a NULL value. In these cases, the NULL_FILTERED index can be considerably smaller and more efficient to maintain than a normal index that includes NULL values.

    Works only in Spanner.

    parser?: string

    Fulltext parser. Works only in MySQL.

    sparse?: 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.

    spatial?: boolean

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

    unique?: boolean

    Indicates if this composite index must be unique or not.

    where?: string

    Index filter condition.