UNPKG

1.61 kBTypeScriptView Raw
1/**
2 * Arguments for IndexMetadata class.
3 */
4export interface IndexMetadataArgs {
5 /**
6 * Class to which index is applied.
7 */
8 target: Function | string;
9 /**
10 * Index name.
11 */
12 name?: string;
13 /**
14 * Columns combination to be used as index.
15 */
16 columns?: ((object?: any) => (any[] | {
17 [key: string]: number;
18 })) | string[];
19 /**
20 * Indicates if index must be unique or not.
21 */
22 unique?: boolean;
23 /**
24 * The SPATIAL modifier indexes the entire column and does not allow indexed columns to contain NULL values.
25 * Works only in MySQL.
26 */
27 spatial?: boolean;
28 /**
29 * The FULLTEXT modifier indexes the entire column and does not allow prefixing.
30 * Works only in MySQL.
31 */
32 fulltext?: boolean;
33 /**
34 * Index filter condition.
35 */
36 where?: string;
37 /**
38 * Indicates if index must sync with database index.
39 */
40 synchronize?: boolean;
41 /**
42 * If true, the index only references documents with the specified field.
43 * These indexes use less space but behave differently in some situations (particularly sorts).
44 * This option is only supported for mongodb database.
45 */
46 sparse?: boolean;
47 /**
48 * Builds the index in the background so that building an index an does not block other database activities.
49 * This option is only supported for mongodb database.
50 */
51 background?: boolean;
52 /**
53 * Specifies a time to live, in seconds.
54 * This option is only supported for mongodb database.
55 */
56 expireAfterSeconds?: number;
57}
58
\No newline at end of file