Type alias CollectionIndexingOptions<Schema>

CollectionIndexingOptions<Schema>: {
    allow: (keyof ToDotNotation<Schema> | string)[] | ["*"];
    deny?: never;
} | {
    allow?: never;
    deny: (keyof ToDotNotation<Schema> | string)[] | ["*"];
}

Represents the options for the indexing.

Only one of allow or deny can be specified.

See indexing for more details.

Type Parameters

Type declaration

Type declaration

Example

const collection1 = await db.createCollection('my-collections', {
  indexing: {
  allow: ['name', 'age'],
  },
});

const collection2 = await db.createCollection('my-collections', {
  indexing: {
  deny: ['*'],
  },
});

Field

allow - The fields to index.

Field

deny - The fields to not index.