* Creates an index on a collection for faster queries. * Indexes significantly improve query performance by allowing constant time lookups * and logarithmic time range queries instead of full scans. * * @param indexCallback - Function that extracts the indexed value from each item * @
(
indexCallback: (row: SingleRowRefProxy<TOutput>) => any,
config: IndexOptions<TIndexType> = {},
)
| 596 | * ``` |
| 597 | */ |
| 598 | public createIndex<TIndexType extends IndexConstructor<TKey>>( |
| 599 | indexCallback: (row: SingleRowRefProxy<TOutput>) => any, |
| 600 | config: IndexOptions<TIndexType> = {}, |
| 601 | ): BaseIndex<TKey> { |
| 602 | return this._indexes.createIndex(indexCallback, config) |
| 603 | } |
| 604 | |
| 605 | /** |
| 606 | * Removes an index created with createIndex. |
no outgoing calls