import type Mongo from './mongo'; import type { CollectionWithSchema } from './collection'; import { Collection } from './collection'; import { ShellApiWithMongoClass } from './decorators'; import { asPrintable } from './enums'; import type { GenericDatabaseSchema, GenericServerSideSchema, StringKey } from './helpers'; import { type ChangeStreamOptions, type CommandOperationOptions, type CreateCollectionOptions, type Document, type WriteConcern, type ListCollectionsOptions } from '@mongosh/service-provider-core'; import { AggregationCursor, RunCommandCursor, CommandResult } from './index'; import type Session from './session'; import ChangeStreamCursor from './change-stream-cursor'; import type { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions, RunCommandOptions, ExplainVerbosityLike, AggregateOptions } from '@mongosh/service-provider-core'; import type { MQLPipeline } from './mql-types'; import type { Abortable } from 'events'; export type CollectionNamesWithTypes = { name: string; badge: string; }; type AuthDoc = { user: string; pwd: string; authDb?: string; mechanism?: string; }; export type DatabaseWithSchema = Database & { [k in StringKey]: Collection; }; export declare class Database extends ShellApiWithMongoClass { _mongo: Mongo; _name: StringKey; _collections: Record, CollectionWithSchema>; _session: Session | undefined; _cachedCollectionNames: StringKey[]; _cachedHello: Document | null; constructor(mongo: Mongo, name: StringKey, session?: Session); _baseOptions(): Promise; _maybeCachedHello(): Promise; [asPrintable](): string; private _emitDatabaseApiCall; _runCommand(cmd: Document, options?: CommandOperationOptions & Abortable): Promise; _runReadCommand(cmd: Document, options?: CommandOperationOptions & Abortable): Promise; _runAdminCommand(cmd: Document, options?: CommandOperationOptions & Abortable): Promise; _runAdminReadCommand(cmd: Document, options?: CommandOperationOptions & Abortable): Promise; _runCursorCommand(cmd: Document, options?: CommandOperationOptions): Promise; _runAdminCursorCommand(cmd: Document, options?: CommandOperationOptions): Promise; _listCollections(filter: Document, options: ListCollectionsOptions & Abortable): Promise; _getCollectionNames(options?: ListCollectionsOptions & Abortable): Promise; _getCollectionNamesWithTypes(options?: ListCollectionsOptions & Abortable): Promise; _getCollectionNamesForCompletion(): Promise; _getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise; getMongo(): Mongo; getName(): StringKey; getCollectionNames(): Promise[]>; getCollectionInfos(filter?: Document, options?: ListCollectionsOptions & Abortable): Promise; runCommand(cmd: string | Document, options?: RunCommandOptions & Abortable): Promise; adminCommand(cmd: string | Document): Promise; aggregate(pipeline: MQLPipeline, options: AggregateOptions & { explain: ExplainVerbosityLike; } & Abortable): Promise; aggregate(pipeline: MQLPipeline, options?: AggregateOptions & Abortable): Promise; aggregate(...stages: MQLPipeline): Promise; getSiblingDB>(db: K): DatabaseWithSchema; getCollection>(coll: K): CollectionWithSchema; dropDatabase(writeConcern?: WriteConcern): Promise; createUser(user: Document, writeConcern?: WriteConcern): Promise; updateUser(username: string, userDoc: Document, writeConcern?: WriteConcern): Promise; changeUserPassword(username: string, password: string, writeConcern?: WriteConcern): Promise; logout(): Promise; dropUser(username: string, writeConcern?: WriteConcern): Promise; dropAllUsers(writeConcern?: WriteConcern): Promise; auth(...args: [AuthDoc] | [string, string] | [string]): Promise<{ ok: number; }>; grantRolesToUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise; revokeRolesFromUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise; getUser(username: string, options?: Document): Promise; getUsers(options?: Document): Promise; createCollection(name: string, options?: CreateCollectionOptions): Promise<{ ok: number; }>; createEncryptedCollection(name: string, options: CreateEncryptedCollectionOptions): Promise<{ collection: Collection; encryptedFields: Document; }>; createView(name: string, source: string, pipeline: MQLPipeline, options?: CreateCollectionOptions): Promise<{ ok: number; }>; createRole(role: Document, writeConcern?: WriteConcern): Promise; updateRole(rolename: string, roleDoc: Document, writeConcern?: WriteConcern): Promise; dropRole(rolename: string, writeConcern?: WriteConcern): Promise; dropAllRoles(writeConcern?: WriteConcern): Promise; grantRolesToRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise; revokeRolesFromRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise; grantPrivilegesToRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise; revokePrivilegesFromRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise; getRole(rolename: string, options?: Document): Promise; getRoles(options?: Document): Promise; _getCurrentOperations(opts: Document | boolean): Promise; currentOp(opts?: Document | boolean): Promise; killOp(opId: number | string): Promise; shutdownServer(opts?: Document): Promise; fsyncLock(): Promise; fsyncUnlock(): Promise; version(): Promise; serverBits(): Promise; isMaster(): Promise; hello(): Promise; serverBuildInfo(): Promise; serverStatus(opts?: {}): Promise; stats(scaleOrOptions?: number | Document): Promise; hostInfo(): Promise; serverCmdLineOpts(): Promise; rotateCertificates(message?: string): Promise; printCollectionStats(scale?: number): Promise; getProfilingStatus(): Promise; setProfilingLevel(level: number, opts?: number | Document): Promise; setLogLevel(logLevel: number, component?: Document | string): Promise; getLogComponents(): Promise; cloneDatabase(): void; cloneCollection(): void; copyDatabase(): void; commandHelp(name: string): Promise; listCommands(): Promise; getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise; getLastError(w?: number | string, wTimeout?: number): Promise; printShardingStatus(verbose?: boolean): Promise; printSecondaryReplicationInfo(): Promise; getReplicationInfo(): Promise; printReplicationInfo(): Promise; printSlaveReplicationInfo(): never; setSecondaryOk(): Promise; watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise; sql(sqlString: string, options?: AggregateOptions): Promise; checkMetadataConsistency(options?: CheckMetadataConsistencyOptions): Promise; } export {};