import type { Document } from '../bson'; import type { BulkWriteOptions } from '../bulk/common'; import type { Collection } from '../collection'; import type { InferIdType } from '../mongo_types'; import type { Server } from '../sdam/server'; import type { ClientSession } from '../sessions'; import type { Callback, MongoDBNamespace } from '../utils'; import { CommandOperation, CommandOperationOptions } from './command'; import { AbstractOperation } from './operation'; /** @internal */ export declare class InsertOperation extends CommandOperation { options: BulkWriteOptions; documents: Document[]; constructor(ns: MongoDBNamespace, documents: Document[], options: BulkWriteOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @public */ export interface InsertOneOptions extends CommandOperationOptions { /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ bypassDocumentValidation?: boolean; /** Force server to assign _id values instead of driver. */ forceServerObjectId?: boolean; } /** @public */ export interface InsertOneResult { /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ acknowledged: boolean; /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ insertedId: InferIdType; } export declare class InsertOneOperation extends InsertOperation { constructor(collection: Collection, doc: Document, options: InsertOneOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } /** @public */ export interface InsertManyResult { /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ acknowledged: boolean; /** The number of inserted documents for this operations */ insertedCount: number; /** Map of the index of the inserted document to the id of the inserted document */ insertedIds: { [key: number]: InferIdType; }; } /** @internal */ export declare class InsertManyOperation extends AbstractOperation { options: BulkWriteOptions; collection: Collection; docs: Document[]; constructor(collection: Collection, docs: Document[], options: BulkWriteOptions); execute(server: Server, session: ClientSession | undefined, callback: Callback): void; } //# sourceMappingURL=insert.d.ts.map