Type alias IndexingOptions<Schema>

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

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-collection', {
  indexing: {
  allow: ['name', 'age'],
  },
});

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

Field

allow - The fields to index.

Field

deny - The fields to not index.