import type { Document } from '../bson'; import type { Collection } from '../collection'; import type { Db } from '../db'; import type { OneOrMore } from '../mongo_types'; import type { Server } from '../sdam/server'; import type { ClientSession } from '../sessions'; import { Callback, MongoDBNamespace } from '../utils'; import { CollationOptions, CommandOperation, CommandOperationOptions, OperationParent } from './command'; import { IndexInformationOptions } from './common_functions'; import { AbstractOperation } from './operation'; /** @public */ export declare type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | number; /** @public */ export declare type IndexSpecification = OneOrMore; /** @public */ export interface IndexDescription extends Pick { collation?: CollationOptions; name?: string; key: Document; } /** @public */ export interface CreateIndexesOptions extends CommandOperationOptions { /** Creates the index in the background, yielding whenever possible. */ background?: boolean; /** Creates an unique index. */ unique?: boolean; /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */ name?: string; /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */ partialFilterExpression?: Document; /** Creates a sparse index. */ sparse?: boolean; /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */ expireAfterSeconds?: number; /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */ storageEngine?: Document; /** (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes. */ commitQuorum?: number | string; /** Specifies the index version number, either 0 or 1. */ version?: number; weights?: Document; default_language?: string; language_override?: string; textIndexVersion?: number; '2dsphereIndexVersion'?: number; bits?: number; /** For geospatial indexes set the lower bound for the co-ordinates. */ min?: number; /** For geospatial indexes set the high bound for the co-ordinates. */ max?: number; bucketSize?: number; wildcardProjection?: Document; /** Specifies that the index should exist on the target collection but should not be used by the query planner when executing operations. (MongoDB 4.4 or higher) */ hidden?: boolean; } /** @internal */ export declare class IndexesOperation extends AbstractOperation { options: IndexInformationOptions; collection: Collection; constructor(collection: Collection, options: IndexInformationOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class CreateIndexesOperation extends CommandOperation { options: CreateIndexesOptions; collectionName: string; indexes: IndexDescription[]; constructor(parent: OperationParent, collectionName: string, indexes: IndexDescription[], options?: CreateIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class CreateIndexOperation extends CreateIndexesOperation { constructor(parent: OperationParent, collectionName: string, indexSpec: IndexSpecification, options?: CreateIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class EnsureIndexOperation extends CreateIndexOperation { db: Db; constructor(db: Db, collectionName: string, indexSpec: IndexSpecification, options?: CreateIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @public */ export declare type DropIndexesOptions = CommandOperationOptions; /** @internal */ export declare class DropIndexOperation extends CommandOperation { options: DropIndexesOptions; collection: Collection; indexName: string; constructor(collection: Collection, indexName: string, options?: DropIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class DropIndexesOperation extends DropIndexOperation { constructor(collection: Collection, options: DropIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @public */ export interface ListIndexesOptions extends CommandOperationOptions { /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */ batchSize?: number; } /** @internal */ export declare class ListIndexesOperation extends CommandOperation { options: ListIndexesOptions; collectionNamespace: MongoDBNamespace; constructor(collection: Collection, options?: ListIndexesOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class IndexExistsOperation extends AbstractOperation { options: IndexInformationOptions; collection: Collection; indexes: string | string[]; constructor(collection: Collection, indexes: string | string[], options: IndexInformationOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @internal */ export declare class IndexInformationOperation extends AbstractOperation { options: IndexInformationOptions; db: Db; name: string; constructor(db: Db, name: string, options?: IndexInformationOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } //# sourceMappingURL=indexes.d.ts.map