@mongodb-js/mongodb-ts-autocomplete 0.4.1 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const files = { "/bson.ts": "/**\n * A class representation of the BSON Binary type.\n * @public\n * @category BSONType\n */\nexport declare class Binary extends BSONValue {\n get _bsontype(): 'Binary';\n /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */\n /** Initial buffer default size */\n static readonly BUFFER_SIZE = 256;\n /** Default BSON type */\n static readonly SUBTYPE_DEFAULT = 0;\n /** Function BSON type */\n static readonly SUBTYPE_FUNCTION = 1;\n /** Byte Array BSON type */\n static readonly SUBTYPE_BYTE_ARRAY = 2;\n /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */\n static readonly SUBTYPE_UUID_OLD = 3;\n /** UUID BSON type */\n static readonly SUBTYPE_UUID = 4;\n /** MD5 BSON type */\n static readonly SUBTYPE_MD5 = 5;\n /** Encrypted BSON type */\n static readonly SUBTYPE_ENCRYPTED = 6;\n /** Column BSON type */\n static readonly SUBTYPE_COLUMN = 7;\n /** Sensitive BSON type */\n static readonly SUBTYPE_SENSITIVE = 8;\n /** Vector BSON type */\n static readonly SUBTYPE_VECTOR = 9;\n /** User BSON type */\n static readonly SUBTYPE_USER_DEFINED = 128;\n /** datatype of a Binary Vector (subtype: 9) */\n static readonly VECTOR_TYPE: Readonly<{\n readonly Int8: 3;\n readonly Float32: 39;\n readonly PackedBit: 16;\n }>;\n /**\n * The bytes of the Binary value.\n *\n * The format of a Binary value in BSON is defined as:\n * ```txt\n * binary\t::= int32 subtype (byte*)\n * ```\n *\n * This `buffer` is the \"(byte*)\" segment.\n *\n * Unless the value is subtype 2, then deserialize will read the first 4 bytes as an int32 and set this to the remaining bytes.\n *\n * ```txt\n * binary\t::= int32 unsigned_byte(2) int32 (byte*)\n * ```\n *\n * @see https://bsonspec.org/spec.html\n */\n buffer: Uint8Array;\n /**\n * The binary subtype.\n *\n * Current defined values are:\n *\n * - `unsigned_byte(0)` Generic binary subtype\n * - `unsigned_byte(1)` Function\n * - `unsigned_byte(2)` Binary (Deprecated)\n * - `unsigned_byte(3)` UUID (Deprecated)\n * - `unsigned_byte(4)` UUID\n * - `unsigned_byte(5)` MD5\n * - `unsigned_byte(6)` Encrypted BSON value\n * - `unsigned_byte(7)` Compressed BSON column\n * - `unsigned_byte(8)` Sensitive\n * - `unsigned_byte(9)` Vector\n * - `unsigned_byte(128)` - `unsigned_byte(255)` User defined\n */\n sub_type: number;\n /**\n * The Binary's `buffer` can be larger than the Binary's content.\n * This property is used to determine where the content ends in the buffer.\n */\n position: number;\n /**\n * Create a new Binary instance.\n * @param buffer - a buffer object containing the binary data.\n * @param subType - the option binary type.\n */\n constructor(buffer?: BinarySequence, subType?: number);\n /**\n * Updates this binary with byte_value.\n *\n * @param byteValue - a single byte we wish to write.\n */\n put(byteValue: string | number | Uint8Array | number[]): void;\n /**\n * Writes a buffer to the binary.\n *\n * @param sequence - a string or buffer to be written to the Binary BSON object.\n * @param offset - specify the binary of where to write the content.\n */\n write(sequence: BinarySequence, offset: number): void;\n /**\n * Returns a view of **length** bytes starting at **position**.\n *\n * @param position - read from the given position in the Binary.\n * @param length - the number of bytes to read.\n */\n read(position: number, length: number): Uint8Array;\n /** returns a view of the binary value as a Uint8Array */\n value(): Uint8Array;\n /** the length of the binary sequence */\n length(): number;\n toJSON(): string;\n toString(encoding?: 'hex' | 'base64' | 'utf8' | 'utf-8'): string;\n /* Excluded from this release type: toExtendedJSON */\n toUUID(): UUID;\n /** Creates an Binary instance from a hex digit string */\n static createFromHexString(hex: string, subType?: number): Binary;\n /** Creates an Binary instance from a base64 string */\n static createFromBase64(base64: string, subType?: number): Binary;\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n /**\n * If this Binary represents a Int8 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Int8`),\n * returns a copy of the bytes in a new Int8Array.\n *\n * If the Binary is not a Vector, or the datatype is not Int8, an error is thrown.\n */\n toInt8Array(): Int8Array;\n /**\n * If this Binary represents a Float32 Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.Float32`),\n * returns a copy of the bytes in a new Float32Array.\n *\n * If the Binary is not a Vector, or the datatype is not Float32, an error is thrown.\n */\n toFloat32Array(): Float32Array;\n /**\n * If this Binary represents packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`),\n * returns a copy of the bytes that are packed bits.\n *\n * Use `toBits` to get the unpacked bits.\n *\n * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown.\n */\n toPackedBits(): Uint8Array;\n /**\n * If this Binary represents a Packed bit Vector (`binary.buffer[0] === Binary.VECTOR_TYPE.PackedBit`),\n * returns a copy of the bit unpacked into a new Int8Array.\n *\n * Use `toPackedBits` to get the bits still in packed form.\n *\n * If the Binary is not a Vector, or the datatype is not PackedBit, an error is thrown.\n */\n toBits(): Int8Array;\n /**\n * Constructs a Binary representing an Int8 Vector.\n * @param array - The array to store as a view on the Binary class\n */\n static fromInt8Array(array: Int8Array): Binary;\n /** Constructs a Binary representing an Float32 Vector. */\n static fromFloat32Array(array: Float32Array): Binary;\n /**\n * Constructs a Binary representing a packed bit Vector.\n *\n * Use `fromBits` to pack an array of 1s and 0s.\n */\n static fromPackedBits(array: Uint8Array, padding?: number): Binary;\n /**\n * Constructs a Binary representing an Packed Bit Vector.\n * @param array - The array of 1s and 0s to pack into the Binary instance\n */\n static fromBits(bits: ArrayLike<number>): Binary;\n}\n\n/** @public */\nexport declare interface BinaryExtended {\n $binary: {\n subType: string;\n base64: string;\n };\n}\n\n/** @public */\nexport declare interface BinaryExtendedLegacy {\n $type: string;\n $binary: string;\n}\n\n/** @public */\nexport declare type BinarySequence = Uint8Array | number[];\n\ndeclare namespace BSON {\n export {\n setInternalBufferSize,\n serialize,\n serializeWithBufferAndIndex,\n deserialize,\n calculateObjectSize,\n deserializeStream,\n UUIDExtended,\n BinaryExtended,\n BinaryExtendedLegacy,\n BinarySequence,\n CodeExtended,\n DBRefLike,\n Decimal128Extended,\n DoubleExtended,\n EJSONOptions,\n Int32Extended,\n LongExtended,\n MaxKeyExtended,\n MinKeyExtended,\n ObjectIdExtended,\n ObjectIdLike,\n BSONRegExpExtended,\n BSONRegExpExtendedLegacy,\n BSONSymbolExtended,\n LongWithoutOverrides,\n TimestampExtended,\n TimestampOverrides,\n LongWithoutOverridesClass,\n SerializeOptions,\n DeserializeOptions,\n Code,\n BSONSymbol,\n DBRef,\n Binary,\n ObjectId,\n UUID,\n Long,\n Timestamp,\n Double,\n Int32,\n MinKey,\n MaxKey,\n BSONRegExp,\n Decimal128,\n BSONValue,\n BSONError,\n BSONVersionError,\n BSONRuntimeError,\n BSONOffsetError,\n BSONType,\n EJSON,\n onDemand,\n OnDemand,\n Document,\n CalculateObjectSizeOptions\n }\n}\nexport { BSON }\n\n/* Excluded from this release type: BSON_MAJOR_VERSION */\n\n/* Excluded from this release type: BSON_VERSION_SYMBOL */\n\n/**\n * @public\n * @experimental\n */\ndeclare type BSONElement = [\ntype: number,\nnameOffset: number,\nnameLength: number,\noffset: number,\nlength: number\n];\n\n/**\n * @public\n * @category Error\n *\n * `BSONError` objects are thrown when BSON encounters an error.\n *\n * This is the parent class for all the other errors thrown by this library.\n */\nexport declare class BSONError extends Error {\n /* Excluded from this release type: bsonError */\n get name(): string;\n constructor(message: string, options?: {\n cause?: unknown;\n });\n /**\n * @public\n *\n * All errors thrown from the BSON library inherit from `BSONError`.\n * This method can assist with determining if an error originates from the BSON library\n * even if it does not pass an `instanceof` check against this class' constructor.\n *\n * @param value - any javascript value that needs type checking\n */\n static isBSONError(value: unknown): value is BSONError;\n}\n\n/**\n * @public\n * @category Error\n *\n * @experimental\n *\n * An error generated when BSON bytes are invalid.\n * Reports the offset the parser was able to reach before encountering the error.\n */\nexport declare class BSONOffsetError extends BSONError {\n get name(): 'BSONOffsetError';\n offset: number;\n constructor(message: string, offset: number, options?: {\n cause?: unknown;\n });\n}\n\n/**\n * A class representation of the BSON RegExp type.\n * @public\n * @category BSONType\n */\nexport declare class BSONRegExp extends BSONValue {\n get _bsontype(): 'BSONRegExp';\n pattern: string;\n options: string;\n /**\n * @param pattern - The regular expression pattern to match\n * @param options - The regular expression options\n */\n constructor(pattern: string, options?: string);\n static parseOptions(options?: string): string;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface BSONRegExpExtended {\n $regularExpression: {\n pattern: string;\n options: string;\n };\n}\n\n/** @public */\nexport declare interface BSONRegExpExtendedLegacy {\n $regex: string | BSONRegExp;\n $options: string;\n}\n\n/**\n * @public\n * @category Error\n *\n * An error generated when BSON functions encounter an unexpected input\n * or reaches an unexpected/invalid internal state\n *\n */\nexport declare class BSONRuntimeError extends BSONError {\n get name(): 'BSONRuntimeError';\n constructor(message: string);\n}\n\n/**\n * A class representation of the BSON Symbol type.\n * @public\n * @category BSONType\n */\nexport declare class BSONSymbol extends BSONValue {\n get _bsontype(): 'BSONSymbol';\n value: string;\n /**\n * @param value - the string representing the symbol.\n */\n constructor(value: string);\n /** Access the wrapped string value. */\n valueOf(): string;\n toString(): string;\n toJSON(): string;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface BSONSymbolExtended {\n $symbol: string;\n}\n\n/** @public */\nexport declare const BSONType: Readonly<{\n readonly double: 1;\n readonly string: 2;\n readonly object: 3;\n readonly array: 4;\n readonly binData: 5;\n readonly undefined: 6;\n readonly objectId: 7;\n readonly bool: 8;\n readonly date: 9;\n readonly null: 10;\n readonly regex: 11;\n readonly dbPointer: 12;\n readonly javascript: 13;\n readonly symbol: 14;\n readonly javascriptWithScope: 15;\n readonly int: 16;\n readonly timestamp: 17;\n readonly long: 18;\n readonly decimal: 19;\n readonly minKey: -1;\n readonly maxKey: 127;\n}>;\n\n/** @public */\nexport declare type BSONType = (typeof BSONType)[keyof typeof BSONType];\n\n/** @public */\nexport declare abstract class BSONValue {\n /** @public */\n abstract get _bsontype(): string;\n /* Excluded from this release type: [BSON_VERSION_SYMBOL] */\n /**\n * @public\n * Prints a human-readable string of BSON value information\n * If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify\n */\n abstract inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n /* Excluded from this release type: toExtendedJSON */\n}\n\n/**\n * @public\n * @category Error\n */\nexport declare class BSONVersionError extends BSONError {\n get name(): 'BSONVersionError';\n constructor();\n}\n\n/**\n * @public\n * @experimental\n *\n * A collection of functions that help work with data in a Uint8Array.\n * ByteUtils is configured at load time to use Node.js or Web based APIs for the internal implementations.\n */\ndeclare type ByteUtils = {\n /** Transforms the input to an instance of Buffer if running on node, otherwise Uint8Array */\n toLocalBufferType: (buffer: Uint8Array | ArrayBufferView | ArrayBuffer) => Uint8Array;\n /** Create empty space of size */\n allocate: (size: number) => Uint8Array;\n /** Create empty space of size, use pooled memory when available */\n allocateUnsafe: (size: number) => Uint8Array;\n /** Check if two Uint8Arrays are deep equal */\n equals: (a: Uint8Array, b: Uint8Array) => boolean;\n /** Check if two Uint8Arrays are deep equal */\n fromNumberArray: (array: number[]) => Uint8Array;\n /** Create a Uint8Array from a base64 string */\n fromBase64: (base64: string) => Uint8Array;\n /** Create a base64 string from bytes */\n toBase64: (buffer: Uint8Array) => string;\n /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */\n fromISO88591: (codePoints: string) => Uint8Array;\n /** **Legacy** binary strings are an outdated method of data transfer. Do not add public API support for interpreting this format */\n toISO88591: (buffer: Uint8Array) => string;\n /** Create a Uint8Array from a hex string */\n fromHex: (hex: string) => Uint8Array;\n /** Create a lowercase hex string from bytes */\n toHex: (buffer: Uint8Array) => string;\n /** Create a string from utf8 code units, fatal=true will throw an error if UTF-8 bytes are invalid, fatal=false will insert replacement characters */\n toUTF8: (buffer: Uint8Array, start: number, end: number, fatal: boolean) => string;\n /** Get the utf8 code unit count from a string if it were to be transformed to utf8 */\n utf8ByteLength: (input: string) => number;\n /** Encode UTF8 bytes generated from `source` string into `destination` at byteOffset. Returns the number of bytes encoded. */\n encodeUTF8Into: (destination: Uint8Array, source: string, byteOffset: number) => number;\n /** Generate a Uint8Array filled with random bytes with byteLength */\n randomBytes: (byteLength: number) => Uint8Array;\n /** Interprets `buffer` as an array of 32-bit values and swaps the byte order in-place. */\n swap32: (buffer: Uint8Array) => Uint8Array;\n};\n\n/* Excluded declaration from this release type: ByteUtils */\n\n/**\n * Calculate the bson size for a passed in Javascript object.\n *\n * @param object - the Javascript object to calculate the BSON byte size for\n * @returns size of BSON object in bytes\n * @public\n */\nexport declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number;\n\n/** @public */\nexport declare type CalculateObjectSizeOptions = Pick<SerializeOptions, 'serializeFunctions' | 'ignoreUndefined'>;\n\n/**\n * A class representation of the BSON Code type.\n * @public\n * @category BSONType\n */\nexport declare class Code extends BSONValue {\n get _bsontype(): 'Code';\n code: string;\n scope: Document | null;\n /**\n * @param code - a string or function.\n * @param scope - an optional scope for the function.\n */\n constructor(code: string | Function, scope?: Document | null);\n toJSON(): {\n code: string;\n scope?: Document;\n };\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface CodeExtended {\n $code: string;\n $scope?: Document;\n}\n\n/**\n * A class representation of the BSON DBRef type.\n * @public\n * @category BSONType\n */\nexport declare class DBRef extends BSONValue {\n get _bsontype(): 'DBRef';\n collection: string;\n oid: ObjectId;\n db?: string;\n fields: Document;\n /**\n * @param collection - the collection name.\n * @param oid - the reference ObjectId.\n * @param db - optional db name, if omitted the reference is local to the current db.\n */\n constructor(collection: string, oid: ObjectId, db?: string, fields?: Document);\n /* Excluded from this release type: namespace */\n /* Excluded from this release type: namespace */\n toJSON(): DBRefLike & Document;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface DBRefLike {\n $ref: string;\n $id: ObjectId;\n $db?: string;\n}\n\n/**\n * A class representation of the BSON Decimal128 type.\n * @public\n * @category BSONType\n */\nexport declare class Decimal128 extends BSONValue {\n get _bsontype(): 'Decimal128';\n readonly bytes: Uint8Array;\n /**\n * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order,\n * or a string representation as returned by .toString()\n */\n constructor(bytes: Uint8Array | string);\n /**\n * Create a Decimal128 instance from a string representation\n *\n * @param representation - a numeric string representation.\n */\n static fromString(representation: string): Decimal128;\n /**\n * Create a Decimal128 instance from a string representation, allowing for rounding to 34\n * significant digits\n *\n * @example Example of a number that will be rounded\n * ```ts\n * > let d = Decimal128.fromString('37.499999999999999196428571428571375')\n * Uncaught:\n * BSONError: \"37.499999999999999196428571428571375\" is not a valid Decimal128 string - inexact rounding\n * at invalidErr (/home/wajames/js-bson/lib/bson.cjs:1402:11)\n * at Decimal128.fromStringInternal (/home/wajames/js-bson/lib/bson.cjs:1633:25)\n * at Decimal128.fromString (/home/wajames/js-bson/lib/bson.cjs:1424:27)\n *\n * > d = Decimal128.fromStringWithRounding('37.499999999999999196428571428571375')\n * new Decimal128(\"37.49999999999999919642857142857138\")\n * ```\n * @param representation - a numeric string representation.\n */\n static fromStringWithRounding(representation: string): Decimal128;\n private static _fromString;\n /** Create a string representation of the raw Decimal128 value */\n toString(): string;\n toJSON(): Decimal128Extended;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface Decimal128Extended {\n $numberDecimal: string;\n}\n\n/**\n * Deserialize data as BSON.\n *\n * @param buffer - the buffer containing the serialized set of BSON documents.\n * @returns returns the deserialized Javascript Object.\n * @public\n */\nexport declare function deserialize(buffer: Uint8Array, options?: DeserializeOptions): Document;\n\n/** @public */\nexport declare interface DeserializeOptions {\n /**\n * when deserializing a Long return as a BigInt.\n * @defaultValue `false`\n */\n useBigInt64?: boolean;\n /**\n * when deserializing a Long will fit it into a Number if it's smaller than 53 bits.\n * @defaultValue `true`\n */\n promoteLongs?: boolean;\n /**\n * when deserializing a Binary will return it as a node.js Buffer instance.\n * @defaultValue `false`\n */\n promoteBuffers?: boolean;\n /**\n * when deserializing will promote BSON values to their Node.js closest equivalent types.\n * @defaultValue `true`\n */\n promoteValues?: boolean;\n /**\n * allow to specify if there what fields we wish to return as unserialized raw buffer.\n * @defaultValue `null`\n */\n fieldsAsRaw?: Document;\n /**\n * return BSON regular expressions as BSONRegExp instances.\n * @defaultValue `false`\n */\n bsonRegExp?: boolean;\n /**\n * allows the buffer to be larger than the parsed BSON object.\n * @defaultValue `false`\n */\n allowObjectSmallerThanBufferSize?: boolean;\n /**\n * Offset into buffer to begin reading document from\n * @defaultValue `0`\n */\n index?: number;\n raw?: boolean;\n /** Allows for opt-out utf-8 validation for all keys or\n * specified keys. Must be all true or all false.\n *\n * @example\n * ```js\n * // disables validation on all keys\n * validation: { utf8: false }\n *\n * // enables validation only on specified keys a, b, and c\n * validation: { utf8: { a: true, b: true, c: true } }\n *\n * // disables validation only on specified keys a, b\n * validation: { utf8: { a: false, b: false } }\n * ```\n */\n validation?: {\n utf8: boolean | Record<string, true> | Record<string, false>;\n };\n}\n\n/**\n * Deserialize stream data as BSON documents.\n *\n * @param data - the buffer containing the serialized set of BSON documents.\n * @param startIndex - the start index in the data Buffer where the deserialization is to start.\n * @param numberOfDocuments - number of documents to deserialize.\n * @param documents - an array where to store the deserialized documents.\n * @param docStartIndex - the index in the documents array from where to start inserting documents.\n * @param options - additional options used for the deserialization.\n * @returns next index in the buffer after deserialization **x** numbers of documents.\n * @public\n */\nexport declare function deserializeStream(data: Uint8Array | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number;\n\n/** @public */\nexport declare interface Document {\n [key: string]: any;\n}\n\n/**\n * A class representation of the BSON Double type.\n * @public\n * @category BSONType\n */\nexport declare class Double extends BSONValue {\n get _bsontype(): 'Double';\n value: number;\n /**\n * Create a Double type\n *\n * @param value - the number we want to represent as a double.\n */\n constructor(value: number);\n /**\n * Attempt to create an double type from string.\n *\n * This method will throw a BSONError on any string input that is not representable as a IEEE-754 64-bit double.\n * Notably, this method will also throw on the following string formats:\n * - Strings in non-decimal and non-exponential formats (binary, hex, or octal digits)\n * - Strings with characters other than numeric, floating point, or leading sign characters (Note: 'Infinity', '-Infinity', and 'NaN' input strings are still allowed)\n * - Strings with leading and/or trailing whitespace\n *\n * Strings with leading zeros, however, are also allowed\n *\n * @param value - the string we want to represent as a double.\n */\n static fromString(value: string): Double;\n /**\n * Access the number value.\n *\n * @returns returns the wrapped double number.\n */\n valueOf(): number;\n toJSON(): number;\n toString(radix?: number): string;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface DoubleExtended {\n $numberDouble: string;\n}\n\n/** @public */\nexport declare const EJSON: {\n parse: typeof parse;\n stringify: typeof stringify;\n serialize: typeof EJSONserialize;\n deserialize: typeof EJSONdeserialize;\n};\n\n/**\n * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types\n *\n * @param ejson - The Extended JSON object to deserialize\n * @param options - Optional settings passed to the parse method\n */\ndeclare function EJSONdeserialize(ejson: Document, options?: EJSONOptions): any;\n\n/** @public */\nexport declare type EJSONOptions = {\n /**\n * Output using the Extended JSON v1 spec\n * @defaultValue `false`\n */\n legacy?: boolean;\n /**\n * Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types\n * @defaultValue `false` */\n relaxed?: boolean;\n /**\n * Enable native bigint support\n * @defaultValue `false`\n */\n useBigInt64?: boolean;\n};\n\n/**\n * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object.\n *\n * @param value - The object to serialize\n * @param options - Optional settings passed to the `stringify` function\n */\ndeclare function EJSONserialize(value: any, options?: EJSONOptions): Document;\n\ndeclare type InspectFn = (x: unknown, options?: unknown) => string;\n\n/**\n * A class representation of a BSON Int32 type.\n * @public\n * @category BSONType\n */\nexport declare class Int32 extends BSONValue {\n get _bsontype(): 'Int32';\n value: number;\n /**\n * Create an Int32 type\n *\n * @param value - the number we want to represent as an int32.\n */\n constructor(value: number | string);\n /**\n * Attempt to create an Int32 type from string.\n *\n * This method will throw a BSONError on any string input that is not representable as an Int32.\n * Notably, this method will also throw on the following string formats:\n * - Strings in non-decimal formats (exponent notation, binary, hex, or octal digits)\n * - Strings non-numeric and non-leading sign characters (ex: '2.0', '24,000')\n * - Strings with leading and/or trailing whitespace\n *\n * Strings with leading zeros, however, are allowed.\n *\n * @param value - the string we want to represent as an int32.\n */\n static fromString(value: string): Int32;\n /**\n * Access the number value.\n *\n * @returns returns the wrapped int32 number.\n */\n valueOf(): number;\n toString(radix?: number): string;\n toJSON(): number;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface Int32Extended {\n $numberInt: string;\n}\n\n/**\n * A class representing a 64-bit integer\n * @public\n * @category BSONType\n * @remarks\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * Javascript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16 bit pieces, which can easily be\n * multiplied within Javascript's floating-point representation without overflow\n * or change in sign.\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class.\n */\nexport declare class Long extends BSONValue {\n get _bsontype(): 'Long';\n /** An indicator used to reliably determine if an object is a Long or not. */\n get __isLong__(): boolean;\n /**\n * The high 32 bits as a signed value.\n */\n high: number;\n /**\n * The low 32 bits as a signed value.\n */\n low: number;\n /**\n * Whether unsigned or not.\n */\n unsigned: boolean;\n /**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n *\n * @param low - The low (signed) 32 bits of the long\n * @param high - The high (signed) 32 bits of the long\n * @param unsigned - Whether unsigned or not, defaults to signed\n */\n constructor(low: number, high?: number, unsigned?: boolean);\n /**\n * Constructs a 64 bit two's-complement integer, given a bigint representation.\n *\n * @param value - BigInt representation of the long value\n * @param unsigned - Whether unsigned or not, defaults to signed\n */\n constructor(value: bigint, unsigned?: boolean);\n /**\n * Constructs a 64 bit two's-complement integer, given a string representation.\n *\n * @param value - String representation of the long value\n * @param unsigned - Whether unsigned or not, defaults to signed\n */\n constructor(value: string, unsigned?: boolean);\n static TWO_PWR_24: Long;\n /** Maximum unsigned value. */\n static MAX_UNSIGNED_VALUE: Long;\n /** Signed zero */\n static ZERO: Long;\n /** Unsigned zero. */\n static UZERO: Long;\n /** Signed one. */\n static ONE: Long;\n /** Unsigned one. */\n static UONE: Long;\n /** Signed negative one. */\n static NEG_ONE: Long;\n /** Maximum signed value. */\n static MAX_VALUE: Long;\n /** Minimum signed value. */\n static MIN_VALUE: Long;\n /**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits.\n * Each is assumed to use 32 bits.\n * @param lowBits - The low 32 bits\n * @param highBits - The high 32 bits\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long;\n /**\n * Returns a Long representing the given 32 bit integer value.\n * @param value - The 32 bit integer in question\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromInt(value: number, unsigned?: boolean): Long;\n /**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @param value - The number in question\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromNumber(value: number, unsigned?: boolean): Long;\n /**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @param value - The number in question\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromBigInt(value: bigint, unsigned?: boolean): Long;\n /* Excluded from this release type: _fromString */\n /**\n * Returns a signed Long representation of the given string, written using radix 10.\n * Will throw an error if the given text is not exactly representable as a Long.\n * Throws an error if any of the following conditions are true:\n * - the string contains invalid characters for the radix 10\n * - the string contains whitespace\n * - the value the string represents is too large or too small to be a Long\n * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero\n * @param str - The textual representation of the Long\n * @returns The corresponding Long value\n */\n static fromStringStrict(str: string): Long;\n /**\n * Returns a Long representation of the given string, written using the radix 10.\n * Will throw an error if the given parameters are not exactly representable as a Long.\n * Throws an error if any of the following conditions are true:\n * - the string contains invalid characters for the given radix\n * - the string contains whitespace\n * - the value the string represents is too large or too small to be a Long\n * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero\n * @param str - The textual representation of the Long\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromStringStrict(str: string, unsigned?: boolean): Long;\n /**\n * Returns a signed Long representation of the given string, written using the specified radix.\n * Will throw an error if the given parameters are not exactly representable as a Long.\n * Throws an error if any of the following conditions are true:\n * - the string contains invalid characters for the given radix\n * - the string contains whitespace\n * - the value the string represents is too large or too small to be a Long\n * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero\n * @param str - The textual representation of the Long\n * @param radix - The radix in which the text is written (2-36), defaults to 10\n * @returns The corresponding Long value\n */\n static fromStringStrict(str: string, radix?: boolean): Long;\n /**\n * Returns a Long representation of the given string, written using the specified radix.\n * Will throw an error if the given parameters are not exactly representable as a Long.\n * Throws an error if any of the following conditions are true:\n * - the string contains invalid characters for the given radix\n * - the string contains whitespace\n * - the value the string represents is too large or too small to be a Long\n * Unlike Long.fromString, this method does not coerce '+/-Infinity' and 'NaN' to Long.Zero\n * @param str - The textual representation of the Long\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @param radix - The radix in which the text is written (2-36), defaults to 10\n * @returns The corresponding Long value\n */\n static fromStringStrict(str: string, unsigned?: boolean, radix?: number): Long;\n /**\n * Returns a signed Long representation of the given string, written using radix 10.\n *\n * If the input string is empty, this function will throw a BSONError.\n *\n * If input string does not have valid signed 64-bit Long representation, this method will return a coerced value:\n * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively\n * - 'NaN' or '+/-Infinity' are coerced to Long.ZERO\n * - other invalid characters sequences have variable behavior\n *\n * @param str - The textual representation of the Long\n * @returns The corresponding Long value\n */\n static fromString(str: string): Long;\n /**\n * Returns a signed Long representation of the given string, written using the provided radix.\n *\n * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError.\n *\n * If input parameters do not have valid signed 64-bit Long representation, this method will return a coerced value:\n * - inputs that overflow 64-bit signed long will be coerced to Long.MAX_VALUE and Long.MIN_VALUE respectively\n * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO\n * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO\n * - other invalid characters sequences have variable behavior\n * @param str - The textual representation of the Long\n * @param radix - The radix in which the text is written (2-36), defaults to 10\n * @returns The corresponding Long value\n */\n static fromString(str: string, radix?: number): Long;\n /**\n * Returns a Long representation of the given string, written using radix 10.\n *\n * If the input string is empty, this function will throw a BSONError.\n *\n * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value:\n * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values\n * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO\n * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO\n * - other invalid characters sequences have variable behavior\n * @param str - The textual representation of the Long\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromString(str: string, unsigned?: boolean): Long;\n /**\n * Returns a Long representation of the given string, written using the specified radix.\n *\n * If the input string is empty or a provided radix is not within (2-36), this function will throw a BSONError.\n *\n * If input parameters do not have a valid 64-bit Long representation, this method will return a coerced value:\n * - inputs that overflow 64-bit long will be coerced to max or min (if signed) values\n * - if the radix is less than 24, 'NaN' is coerced to Long.ZERO\n * - if the radix is less than 35, '+/-Infinity' inputs are coerced to Long.ZERO\n * - other invalid characters sequences have variable behavior\n * @param str - The textual representation of the Long\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @param radix - The radix in which the text is written (2-36), defaults to 10\n * @returns The corresponding Long value\n */\n static fromString(str: string, unsigned?: boolean, radix?: number): Long;\n /**\n * Creates a Long from its byte representation.\n * @param bytes - Byte representation\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @param le - Whether little or big endian, defaults to big endian\n * @returns The corresponding Long value\n */\n static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long;\n /**\n * Creates a Long from its little endian byte representation.\n * @param bytes - Little endian byte representation\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromBytesLE(bytes: number[], unsigned?: boolean): Long;\n /**\n * Creates a Long from its big endian byte representation.\n * @param bytes - Big endian byte representation\n * @param unsigned - Whether unsigned or not, defaults to signed\n * @returns The corresponding Long value\n */\n static fromBytesBE(bytes: number[], unsigned?: boolean): Long;\n /**\n * Tests if the specified object is a Long.\n */\n static isLong(value: unknown): value is Long;\n /**\n * Converts the specified value to a Long.\n * @param unsigned - Whether unsigned or not, defaults to signed\n */\n static fromValue(val: number | string | {\n low: number;\n high: number;\n unsigned?: boolean;\n }, unsigned?: boolean): Long;\n /** Returns the sum of this and the specified Long. */\n add(addend: string | number | Long | Timestamp): Long;\n /**\n * Returns the sum of this and the specified Long.\n * @returns Sum\n */\n and(other: string | number | Long | Timestamp): Long;\n /**\n * Compares this Long's value with the specified's.\n * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater\n */\n compare(other: string | number | Long | Timestamp): 0 | 1 | -1;\n /** This is an alias of {@link Long.compare} */\n comp(other: string | number | Long | Timestamp): 0 | 1 | -1;\n /**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned.\n * @returns Quotient\n */\n divide(divisor: string | number | Long | Timestamp): Long;\n /**This is an alias of {@link Long.divide} */\n div(divisor: string | number | Long | Timestamp): Long;\n /**\n * Tests if this Long's value equals the specified's.\n * @param other - Other value\n */\n equals(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.equals} */\n eq(other: string | number | Long | Timestamp): boolean;\n /** Gets the high 32 bits as a signed integer. */\n getHighBits(): number;\n /** Gets the high 32 bits as an unsigned integer. */\n getHighBitsUnsigned(): number;\n /** Gets the low 32 bits as a signed integer. */\n getLowBits(): number;\n /** Gets the low 32 bits as an unsigned integer. */\n getLowBitsUnsigned(): number;\n /** Gets the number of bits needed to represent the absolute value of this Long. */\n getNumBitsAbs(): number;\n /** Tests if this Long's value is greater than the specified's. */\n greaterThan(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.greaterThan} */\n gt(other: string | number | Long | Timestamp): boolean;\n /** Tests if this Long's value is greater than or equal the specified's. */\n greaterThanOrEqual(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.greaterThanOrEqual} */\n gte(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.greaterThanOrEqual} */\n ge(other: string | number | Long | Timestamp): boolean;\n /** Tests if this Long's value is even. */\n isEven(): boolean;\n /** Tests if this Long's value is negative. */\n isNegative(): boolean;\n /** Tests if this Long's value is odd. */\n isOdd(): boolean;\n /** Tests if this Long's value is positive. */\n isPositive(): boolean;\n /** Tests if this Long's value equals zero. */\n isZero(): boolean;\n /** Tests if this Long's value is less than the specified's. */\n lessThan(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long#lessThan}. */\n lt(other: string | number | Long | Timestamp): boolean;\n /** Tests if this Long's value is less than or equal the specified's. */\n lessThanOrEqual(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.lessThanOrEqual} */\n lte(other: string | number | Long | Timestamp): boolean;\n /** Returns this Long modulo the specified. */\n modulo(divisor: string | number | Long | Timestamp): Long;\n /** This is an alias of {@link Long.modulo} */\n mod(divisor: string | number | Long | Timestamp): Long;\n /** This is an alias of {@link Long.modulo} */\n rem(divisor: string | number | Long | Timestamp): Long;\n /**\n * Returns the product of this and the specified Long.\n * @param multiplier - Multiplier\n * @returns Product\n */\n multiply(multiplier: string | number | Long | Timestamp): Long;\n /** This is an alias of {@link Long.multiply} */\n mul(multiplier: string | number | Long | Timestamp): Long;\n /** Returns the Negation of this Long's value. */\n negate(): Long;\n /** This is an alias of {@link Long.negate} */\n neg(): Long;\n /** Returns the bitwise NOT of this Long. */\n not(): Long;\n /** Tests if this Long's value differs from the specified's. */\n notEquals(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.notEquals} */\n neq(other: string | number | Long | Timestamp): boolean;\n /** This is an alias of {@link Long.notEquals} */\n ne(other: string | number | Long | Timestamp): boolean;\n /**\n * Returns the bitwise OR of this Long and the specified.\n */\n or(other: number | string | Long): Long;\n /**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param numBits - Number of bits\n * @returns Shifted Long\n */\n shiftLeft(numBits: number | Long): Long;\n /** This is an alias of {@link Long.shiftLeft} */\n shl(numBits: number | Long): Long;\n /**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @param numBits - Number of bits\n * @returns Shifted Long\n */\n shiftRight(numBits: number | Long): Long;\n /** This is an alias of {@link Long.shiftRight} */\n shr(numBits: number | Long): Long;\n /**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @param numBits - Number of bits\n * @returns Shifted Long\n */\n shiftRightUnsigned(numBits: Long | number): Long;\n /** This is an alias of {@link Long.shiftRightUnsigned} */\n shr_u(numBits: number | Long): Long;\n /** This is an alias of {@link Long.shiftRightUnsigned} */\n shru(numBits: number | Long): Long;\n /**\n * Returns the difference of this and the specified Long.\n * @param subtrahend - Subtrahend\n * @returns Difference\n */\n subtract(subtrahend: string | number | Long | Timestamp): Long;\n /** This is an alias of {@link Long.subtract} */\n sub(subtrahend: string | number | Long | Timestamp): Long;\n /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */\n toInt(): number;\n /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */\n toNumber(): number;\n /** Converts the Long to a BigInt (arbitrary precision). */\n toBigInt(): bigint;\n /**\n * Converts this Long to its byte representation.\n * @param le - Whether little or big endian, defaults to big endian\n * @returns Byte representation\n */\n toBytes(le?: boolean): number[];\n /**\n * Converts this Long to its little endian byte representation.\n * @returns Little endian byte representation\n */\n toBytesLE(): number[];\n /**\n * Converts this Long to its big endian byte representation.\n * @returns Big endian byte representation\n */\n toBytesBE(): number[];\n /**\n * Converts this Long to signed.\n */\n toSigned(): Long;\n /**\n * Converts the Long to a string written in the specified radix.\n * @param radix - Radix (2-36), defaults to 10\n * @throws RangeError If `radix` is out of range\n */\n toString(radix?: number): string;\n /** Converts this Long to unsigned. */\n toUnsigned(): Long;\n /** Returns the bitwise XOR of this Long and the given one. */\n xor(other: Long | number | string): Long;\n /** This is an alias of {@link Long.isZero} */\n eqz(): boolean;\n /** This is an alias of {@link Long.lessThanOrEqual} */\n le(other: string | number | Long | Timestamp): boolean;\n toExtendedJSON(options?: EJSONOptions): number | LongExtended;\n static fromExtendedJSON(doc: {\n $numberLong: string;\n }, options?: EJSONOptions): number | Long | bigint;\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface LongExtended {\n $numberLong: string;\n}\n\n/** @public */\nexport declare type LongWithoutOverrides = new (low: unknown, high?: number | boolean, unsigned?: boolean) => {\n [P in Exclude<keyof Long, TimestampOverrides>]: Long[P];\n};\n\n/** @public */\nexport declare const LongWithoutOverridesClass: LongWithoutOverrides;\n\n/**\n * A class representation of the BSON MaxKey type.\n * @public\n * @category BSONType\n */\nexport declare class MaxKey extends BSONValue {\n get _bsontype(): 'MaxKey';\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(): string;\n}\n\n/** @public */\nexport declare interface MaxKeyExtended {\n $maxKey: 1;\n}\n\n/**\n * A class representation of the BSON MinKey type.\n * @public\n * @category BSONType\n */\nexport declare class MinKey extends BSONValue {\n get _bsontype(): 'MinKey';\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(): string;\n}\n\n/** @public */\nexport declare interface MinKeyExtended {\n $minKey: 1;\n}\n\n/**\n * @experimental\n * @public\n *\n * A collection of functions that get or set various numeric types and bit widths from a Uint8Array.\n */\ndeclare type NumberUtils = {\n /** Is true if the current system is big endian. */\n isBigEndian: boolean;\n /**\n * Parses a signed int32 at offset. Throws a `RangeError` if value is negative.\n */\n getNonnegativeInt32LE: (source: Uint8Array, offset: number) => number;\n getInt32LE: (source: Uint8Array, offset: number) => number;\n getUint32LE: (source: Uint8Array, offset: number) => number;\n getUint32BE: (source: Uint8Array, offset: number) => number;\n getBigInt64LE: (source: Uint8Array, offset: number) => bigint;\n getFloat64LE: (source: Uint8Array, offset: number) => number;\n setInt32BE: (destination: Uint8Array, offset: number, value: number) => 4;\n setInt32LE: (destination: Uint8Array, offset: number, value: number) => 4;\n setBigInt64LE: (destination: Uint8Array, offset: number, value: bigint) => 8;\n setFloat64LE: (destination: Uint8Array, offset: number, value: number) => 8;\n};\n\n/**\n * Number parsing and serializing utilities.\n *\n * @experimental\n * @public\n */\ndeclare const NumberUtils: NumberUtils;\n\n/**\n * A class representation of the BSON ObjectId type.\n * @public\n * @category BSONType\n */\nexport declare class ObjectId extends BSONValue {\n get _bsontype(): 'ObjectId';\n /* Excluded from this release type: index */\n static cacheHexString: boolean;\n /* Excluded from this release type: buffer */\n /**\n * Create ObjectId from a number.\n *\n * @param inputId - A number.\n * @deprecated Instead, use `static createFromTime()` to set a numeric value for the new ObjectId.\n */\n constructor(inputId: number);\n /**\n * Create ObjectId from a 24 character hex string.\n *\n * @param inputId - A 24 character hex string.\n */\n constructor(inputId: string);\n /**\n * Create ObjectId from the BSON ObjectId type.\n *\n * @param inputId - The BSON ObjectId type.\n */\n constructor(inputId: ObjectId);\n /**\n * Create ObjectId from the object type that has the toHexString method.\n *\n * @param inputId - The ObjectIdLike type.\n */\n constructor(inputId: ObjectIdLike);\n /**\n * Create ObjectId from a 12 byte binary Buffer.\n *\n * @param inputId - A 12 byte binary Buffer.\n */\n constructor(inputId: Uint8Array);\n /** To generate a new ObjectId, use ObjectId() with no argument. */\n constructor();\n /**\n * Implementation overload.\n *\n * @param inputId - All input types that are used in the constructor implementation.\n */\n constructor(inputId?: string | number | ObjectId | ObjectIdLike | Uint8Array);\n /**\n * The ObjectId bytes\n * @readonly\n */\n get id(): Uint8Array;\n set id(value: Uint8Array);\n /* Excluded from this release type: validateHexString */\n /** Returns the ObjectId id as a 24 lowercase character hex string representation */\n toHexString(): string;\n /* Excluded from this release type: getInc */\n /**\n * Generate a 12 byte id buffer used in ObjectId's\n *\n * @param time - pass in a second based timestamp.\n */\n static generate(time?: number): Uint8Array;\n /**\n * Converts the id into a 24 character hex string for printing, unless encoding is provided.\n * @param encoding - hex or base64\n */\n toString(encoding?: 'hex' | 'base64'): string;\n /** Converts to its JSON the 24 character hex string representation. */\n toJSON(): string;\n /* Excluded from this release type: is */\n /**\n * Compares the equality of this ObjectId with `otherID`.\n *\n * @param otherId - ObjectId instance to compare against.\n */\n equals(otherId: string | ObjectId | ObjectIdLike | undefined | null): boolean;\n /** Returns the generation date (accurate up to the second) that this ID was generated. */\n getTimestamp(): Date;\n /* Excluded from this release type: createPk */\n /* Excluded from this release type: serializeInto */\n /**\n * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId.\n *\n * @param time - an integer number representing a number of seconds.\n */\n static createFromTime(time: number): ObjectId;\n /**\n * Creates an ObjectId from a hex string representation of an ObjectId.\n *\n * @param hexString - create a ObjectId from a passed in 24 character hexstring.\n */\n static createFromHexString(hexString: string): ObjectId;\n /** Creates an ObjectId instance from a base64 string */\n static createFromBase64(base64: string): ObjectId;\n /**\n * Checks if a value can be used to create a valid bson ObjectId\n * @param id - any JS value\n */\n static isValid(id: string | number | ObjectId | ObjectIdLike | Uint8Array): boolean;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n /* Excluded from this release type: isCached */\n /**\n * Converts to a string representation of this Id.\n *\n * @returns return the 24 character hex string representation.\n */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface ObjectIdExtended {\n $oid: string;\n}\n\n/** @public */\nexport declare interface ObjectIdLike {\n id: string | Uint8Array;\n __id?: string;\n toHexString(): string;\n}\n\n/**\n * @experimental\n * @public\n *\n * A new set of BSON APIs that are currently experimental and not intended for production use.\n */\nexport declare type OnDemand = {\n parseToElements: (this: void, bytes: Uint8Array, startOffset?: number) => Iterable<BSONElement>;\n BSONElement: BSONElement;\n ByteUtils: ByteUtils;\n NumberUtils: NumberUtils;\n};\n\n/**\n * @experimental\n * @public\n */\nexport declare const onDemand: OnDemand;\n\n/**\n * Parse an Extended JSON string, constructing the JavaScript value or object described by that\n * string.\n *\n * @example\n * ```js\n * const { EJSON } = require('/bson.ts');\n * const text = '{ \"int32\": { \"$numberInt\": \"10\" } }';\n *\n * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } }\n * console.log(EJSON.parse(text, { relaxed: false }));\n *\n * // prints { int32: 10 }\n * console.log(EJSON.parse(text));\n * ```\n */\ndeclare function parse(text: string, options?: EJSONOptions): any;\n\n/**\n * Serialize a Javascript object.\n *\n * @param object - the Javascript object to serialize.\n * @returns Buffer object containing the serialized object.\n * @public\n */\nexport declare function serialize(object: Document, options?: SerializeOptions): Uint8Array;\n\n/** @public */\nexport declare interface SerializeOptions {\n /**\n * the serializer will check if keys are valid.\n * @defaultValue `false`\n */\n checkKeys?: boolean;\n /**\n * serialize the javascript functions\n * @defaultValue `false`\n */\n serializeFunctions?: boolean;\n /**\n * serialize will not emit undefined fields\n * note that the driver sets this to `false`\n * @defaultValue `true`\n */\n ignoreUndefined?: boolean;\n /* Excluded from this release type: minInternalBufferSize */\n /**\n * the index in the buffer where we wish to start serializing into\n * @defaultValue `0`\n */\n index?: number;\n}\n\n/**\n * Serialize a Javascript object using a predefined Buffer and index into the buffer,\n * useful when pre-allocating the space for serialization.\n *\n * @param object - the Javascript object to serialize.\n * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object.\n * @returns the index pointing to the last written byte in the buffer.\n * @public\n */\nexport declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Uint8Array, options?: SerializeOptions): number;\n\n/**\n * Sets the size of the internal serialization buffer.\n *\n * @param size - The desired size for the internal serialization buffer in bytes\n * @public\n */\nexport declare function setInternalBufferSize(size: number): void;\n\n/**\n * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer\n * function is specified or optionally including only the specified properties if a replacer array\n * is specified.\n *\n * @param value - The value to convert to extended JSON\n * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string\n * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes.\n * @param options - Optional settings\n *\n * @example\n * ```js\n * const { EJSON } = require('/bson.ts');\n * const Int32 = require('/mongodb.ts').Int32;\n * const doc = { int32: new Int32(10) };\n *\n * // prints '{\"int32\":{\"$numberInt\":\"10\"}}'\n * console.log(EJSON.stringify(doc, { relaxed: false }));\n *\n * // prints '{\"int32\":10}'\n * console.log(EJSON.stringify(doc));\n * ```\n */\ndeclare function stringify(value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSONOptions, space?: string | number, options?: EJSONOptions): string;\n\n/**\n * @public\n * @category BSONType\n *\n * A special type for _internal_ MongoDB use and is **not** associated with the regular Date type.\n */\nexport declare class Timestamp extends LongWithoutOverridesClass {\n get _bsontype(): 'Timestamp';\n static readonly MAX_VALUE: Long;\n /**\n * An incrementing ordinal for operations within a given second.\n */\n get i(): number;\n /**\n * A `time_t` value measuring seconds since the Unix epoch\n */\n get t(): number;\n /**\n * @param int - A 64-bit bigint representing the Timestamp.\n */\n constructor(int: bigint);\n /**\n * @param long - A 64-bit Long representing the Timestamp.\n */\n constructor(long: Long);\n /**\n * @param value - A pair of two values indicating timestamp and increment.\n */\n constructor(value: {\n t: number;\n i: number;\n });\n toJSON(): {\n $timestamp: string;\n };\n /** Returns a Timestamp represented by the given (32-bit) integer value. */\n static fromInt(value: number): Timestamp;\n /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */\n static fromNumber(value: number): Timestamp;\n /**\n * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits.\n *\n * @param lowBits - the low 32-bits.\n * @param highBits - the high 32-bits.\n */\n static fromBits(lowBits: number, highBits: number): Timestamp;\n /**\n * Returns a Timestamp from the given string, optionally using the given radix.\n *\n * @param str - the textual representation of the Timestamp.\n * @param optRadix - the radix in which the text is written.\n */\n static fromString(str: string, optRadix: number): Timestamp;\n /* Excluded from this release type: toExtendedJSON */\n /* Excluded from this release type: fromExtendedJSON */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare interface TimestampExtended {\n $timestamp: {\n t: number;\n i: number;\n };\n}\n\n/** @public */\nexport declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect';\n\n/**\n * A class representation of the BSON UUID type.\n * @public\n */\nexport declare class UUID extends Binary {\n /**\n * Create a UUID type\n *\n * When the argument to the constructor is omitted a random v4 UUID will be generated.\n *\n * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer.\n */\n constructor(input?: string | Uint8Array | UUID);\n /**\n * The UUID bytes\n * @readonly\n */\n get id(): Uint8Array;\n set id(value: Uint8Array);\n /**\n * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated)\n * @param includeDashes - should the string exclude dash-separators.\n */\n toHexString(includeDashes?: boolean): string;\n /**\n * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified.\n */\n toString(encoding?: 'hex' | 'base64'): string;\n /**\n * Converts the id into its JSON string representation.\n * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n */\n toJSON(): string;\n /**\n * Compares the equality of this UUID with `otherID`.\n *\n * @param otherId - UUID instance to compare against.\n */\n equals(otherId: string | Uint8Array | UUID): boolean;\n /**\n * Creates a Binary instance from the current UUID.\n */\n toBinary(): Binary;\n /**\n * Generates a populated buffer containing a v4 uuid\n */\n static generate(): Uint8Array;\n /**\n * Checks if a value is a valid bson UUID\n * @param input - UUID, string or Buffer to validate.\n */\n static isValid(input: string | Uint8Array | UUID | Binary): boolean;\n /**\n * Creates an UUID from a hex string representation of an UUID.\n * @param hexString - 32 or 36 character hex string (dashes excluded/included).\n */\n static createFromHexString(hexString: string): UUID;\n /** Creates an UUID from a base64 string representation of an UUID. */\n static createFromBase64(base64: string): UUID;\n /* Excluded from this release type: bytesFromString */\n /* Excluded from this release type: isValidUUIDString */\n /**\n * Converts to a string representation of this Id.\n *\n * @returns return the 36 character hex string representation.\n *\n */\n inspect(depth?: number, options?: unknown, inspect?: InspectFn): string;\n}\n\n/** @public */\nexport declare type UUIDExtended = {\n $uuid: string;\n};\n\nexport { }\n", "/mongodb.ts": "import type { DeserializeOptions } from '/bson.ts';\nimport type { ObjectIdLike } from '/bson.ts';\nimport type { SerializeOptions } from '/bson.ts';\nimport { Binary } from '/bson.ts';\nimport { BSON } from '/bson.ts';\nimport { BSONRegExp } from '/bson.ts';\nimport { BSONSymbol } from '/bson.ts';\nimport { BSONType } from '/bson.ts';\nimport { Code } from '/bson.ts';\nimport { DBRef } from '/bson.ts';\nimport { Decimal128 } from '/bson.ts';\nimport { deserialize } from '/bson.ts';\nimport { Document } from '/bson.ts';\nimport { Double } from '/bson.ts';\nimport { Int32 } from '/bson.ts';\nimport { Long } from '/bson.ts';\nimport { MaxKey } from '/bson.ts';\nimport { MinKey } from '/bson.ts';\nimport { ObjectId } from '/bson.ts';\nimport { serialize } from '/bson.ts';\nimport { Timestamp } from '/bson.ts';\nimport { UUID } from '/bson.ts';\nimport type { SrvRecord } from 'dns';\nimport { EventEmitter } from 'events';\nimport type { Socket } from 'net';\nimport type { TcpNetConnectOpts } from 'net';\nimport { Readable } from 'stream';\nimport { Writable } from 'stream';\nimport type { ConnectionOptions as ConnectionOptions_2 } from 'tls';\nimport type { TLSSocket } from 'tls';\nimport type { TLSSocketOptions } from 'tls';\n\n/** @public */\nexport declare type Abortable = {\n /**\n * @experimental\n * When provided, the corresponding `AbortController` can be used to abort an asynchronous action.\n *\n * The `signal.reason` value is used as the error thrown.\n *\n * @remarks\n * **NOTE:** If an abort signal aborts an operation while the driver is writing to the underlying\n * socket or reading the response from the server, the socket will be closed.\n * If signals are aborted at a high rate during socket read/writes this can lead to a high rate of connection reestablishment.\n *\n * We plan to mitigate this in a future release, please follow NODE-6062 (`timeoutMS` expiration suffers the same limitation).\n *\n * AbortSignals are likely a best fit for human interactive interruption (ex. ctrl-C) where the frequency\n * of cancellation is reasonably low. If a signal is programmatically aborted for 100s of operations you can empty\n * the driver's connection pool.\n *\n * @example\n * ```js\n * const controller = new AbortController();\n * const { signal } = controller;\n * process.on('SIGINT', () => controller.abort(new Error('^C pressed')));\n *\n * try {\n * const res = await fetch('...', { signal });\n * await collection.findOne(await res.json(), { signal });\n * catch (error) {\n * if (error === signal.reason) {\n * // signal abort error handling\n * }\n * }\n * ```\n */\n signal?: AbortSignal | undefined;\n};\n\n/** @public */\nexport declare abstract class AbstractCursor<TSchema = any, CursorEvents extends AbstractCursorEvents = AbstractCursorEvents> extends TypedEventEmitter<CursorEvents> implements AsyncDisposable_2 {\n /* Excluded from this release type: cursorId */\n /* Excluded from this release type: cursorSession */\n /* Excluded from this release type: selectedServer */\n /* Excluded from this release type: cursorNamespace */\n /* Excluded from this release type: documents */\n /* Excluded from this release type: cursorClient */\n /* Excluded from this release type: transform */\n /* Excluded from this release type: initialized */\n /* Excluded from this release type: isClosed */\n /* Excluded from this release type: isKilled */\n /* Excluded from this release type: cursorOptions */\n /* Excluded from this release type: timeoutContext */\n /** @event */\n static readonly CLOSE: \"close\";\n /* Excluded from this release type: deserializationOptions */\n protected signal: AbortSignal | undefined;\n private abortListener;\n /* Excluded from this release type: __constructor */\n /**\n * The cursor has no id until it receives a response from the initial cursor creating command.\n *\n * It is non-zero for as long as the database has an open cursor.\n *\n * The initiating command may receive a zero id if the entire result is in the `firstBatch`.\n */\n get id(): Long | undefined;\n /* Excluded from this release type: isDead */\n /* Excluded from this release type: client */\n /* Excluded from this release type: server */\n get namespace(): MongoDBNamespace;\n get readPreference(): ReadPreference;\n get readConcern(): ReadConcern | undefined;\n /* Excluded from this release type: session */\n /* Excluded from this release type: session */\n /**\n * The cursor is closed and all remaining locally buffered documents have been iterated.\n */\n get closed(): boolean;\n /**\n * A `killCursors` command was attempted on this cursor.\n * This is performed if the cursor id is non zero.\n */\n get killed(): boolean;\n get loadBalanced(): boolean;\n /* Excluded from this release type: [Symbol.asyncDispose] */\n /* Excluded from this release type: asyncDispose */\n /** Adds cursor to client's tracking so it will be closed by MongoClient.close() */\n private trackCursor;\n /** Returns current buffered documents length */\n bufferedCount(): number;\n /** Returns current buffered documents */\n readBufferedDocuments(number?: number): NonNullable<TSchema>[];\n [Symbol.asyncIterator](): AsyncGenerator<TSchema, void, void>;\n stream(options?: CursorStreamOptions): Readable & AsyncIterable<TSchema>;\n hasNext(): Promise<boolean>;\n /** Get the next available document from the cursor, returns null if no more documents are available. */\n next(): Promise<TSchema | null>;\n /**\n * Try to get the next available document from the cursor or `null` if an empty batch is returned\n */\n tryNext(): Promise<TSchema | null>;\n /**\n * Iterates over all the documents for this cursor using the iterator, callback pattern.\n *\n * If the iterator returns `false`, iteration will stop.\n *\n * @param iterator - The iteration callback.\n * @deprecated - Will be removed in a future release. Use for await...of instead.\n */\n forEach(iterator: (doc: TSchema) => boolean | void): Promise<void>;\n /**\n * Frees any client-side resources used by the cursor.\n */\n close(options?: {\n timeoutMS?: number;\n }): Promise<void>;\n /**\n * Returns an array of documents. The caller is responsible for making sure that there\n * is enough memory to store the results. Note that the array only contains partial\n * results when this cursor had been previously accessed. In that case,\n * cursor.rewind() can be used to reset the cursor.\n */\n toArray(): Promise<TSchema[]>;\n /**\n * Add a cursor flag to the cursor\n *\n * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -.\n * @param value - The flag boolean value.\n */\n addCursorFlag(flag: CursorFlag, value: boolean): this;\n /**\n * Map all documents using the provided function\n * If there is a transform set on the cursor, that will be called first and the result passed to\n * this function's transform.\n *\n * @remarks\n *\n * **Note** Cursors use `null` internally to indicate that there are no more documents in the cursor. Providing a mapping\n * function that maps values to `null` will result in the cursor closing itself before it has finished iterating\n * all documents. This will **not** result in a memory leak, just surprising behavior. For example:\n *\n * ```typescript\n * const cursor = collection.find({});\n * cursor.map(() => null);\n *\n * const documents = await cursor.toArray();\n * // documents is always [], regardless of how many documents are in the collection.\n * ```\n *\n * Other falsey values are allowed:\n *\n * ```typescript\n * const cursor = collection.find({});\n * cursor.map(() => '');\n *\n * const documents = await cursor.toArray();\n * // documents is now an array of empty strings\n * ```\n *\n * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor,\n * it **does not** return a new instance of a cursor. This means when calling map,\n * you should always assign the result to a new variable in order to get a correctly typed cursor variable.\n * Take note of the following example:\n *\n * @example\n * ```typescript\n * const cursor: FindCursor<Document> = coll.find();\n * const mappedCursor: FindCursor<number> = cursor.map(doc => Object.keys(doc).length);\n * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[]\n * ```\n * @param transform - The mapping transformation method.\n */\n map<T = any>(transform: (doc: TSchema) => T): AbstractCursor<T>;\n /**\n * Set the ReadPreference for the cursor.\n *\n * @param readPreference - The new read preference for the cursor.\n */\n withReadPreference(readPreference: ReadPreferenceLike): this;\n /**\n * Set the ReadPreference for the cursor.\n *\n * @param readPreference - The new read preference for the cursor.\n */\n withReadConcern(readConcern: ReadConcernLike): this;\n /**\n * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher)\n *\n * @param value - Number of milliseconds to wait before aborting the query.\n */\n maxTimeMS(value: number): this;\n /**\n * Set the batch size for the cursor.\n *\n * @param value - The number of documents to return per batch. See {@link https://www.mongodb.com/docs/manual/reference/command/find/|find command documentation}.\n */\n batchSize(value: number): this;\n /**\n * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will\n * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even\n * if the resultant data has already been retrieved by this cursor.\n */\n rewind(): void;\n /**\n * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance\n */\n abstract clone(): AbstractCursor<TSchema>;\n /* Excluded from this release type: _initialize */\n /* Excluded from this release type: getMore */\n /* Excluded from this release type: cursorInit */\n /* Excluded from this release type: fetchBatch */\n /* Excluded from this release type: cleanup */\n /* Excluded from this release type: hasEmittedClose */\n /* Excluded from this release type: emitClose */\n /* Excluded from this release type: transformDocument */\n /* Excluded from this release type: throwIfInitialized */\n}\n\n/** @public */\nexport declare type AbstractCursorEvents = {\n [AbstractCursor.CLOSE](): void;\n};\n\n/** @public */\nexport declare interface AbstractCursorOptions extends BSONSerializeOptions {\n session?: ClientSession;\n readPreference?: ReadPreferenceLike;\n readConcern?: ReadConcernLike;\n /**\n * Specifies the number of documents to return in each response from MongoDB\n */\n batchSize?: number;\n /**\n * When applicable `maxTimeMS` controls the amount of time the initial command\n * that constructs a cursor should take. (ex. find, aggregate, listCollections)\n */\n maxTimeMS?: number;\n /**\n * When applicable `maxAwaitTimeMS` controls the amount of time subsequent getMores\n * that a cursor uses to fetch more data should take. (ex. cursor.next())\n */\n maxAwaitTimeMS?: number;\n /**\n * Comment to apply to the operation.\n *\n * In server versions pre-4.4, 'comment' must be string. A server\n * error will be thrown if any other type is provided.\n *\n * In server versions 4.4 and above, 'comment' can be any valid BSON type.\n */\n comment?: unknown;\n /**\n * By default, MongoDB will automatically close a cursor when the\n * client has exhausted all results in the cursor. However, for [capped collections](https://www.mongodb.com/docs/manual/core/capped-collections)\n * you may use a Tailable Cursor that remains open after the client exhausts\n * the results in the initial cursor.\n */\n tailable?: boolean;\n /**\n * If awaitData is set to true, when the cursor reaches the end of the capped collection,\n * MongoDB blocks the query thread for a period of time waiting for new data to arrive.\n * When new data is inserted into the capped collection, the blocked thread is signaled\n * to wake up and return the next batch to the client.\n */\n awaitData?: boolean;\n noCursorTimeout?: boolean;\n /** Specifies the time an operation will run until it throws a timeout error. See {@link AbstractCursorOptions.timeoutMode} for more details on how this option applies to cursors. */\n timeoutMS?: number;\n /**\n * @public\n * @experimental\n * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'`\n * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of\n * `cursor.next()`.\n * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor.\n *\n * Depending on the type of cursor being used, this option has different default values.\n * For non-tailable cursors, this value defaults to `'cursorLifetime'`\n * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by\n * definition can have an arbitrarily long lifetime.\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'});\n * for await (const doc of cursor) {\n * // process doc\n * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but\n * // will continue to iterate successfully otherwise, regardless of the number of batches.\n * }\n * ```\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' });\n * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms.\n * ```\n */\n timeoutMode?: CursorTimeoutMode;\n /* Excluded from this release type: timeoutContext */\n}\n\n/* Excluded from this release type: AbstractOperation */\n\n/** @public */\nexport declare type AcceptedFields<TSchema, FieldType, AssignableType> = {\n readonly [key in KeysOfAType<TSchema, FieldType>]?: AssignableType;\n};\n\n/** @public */\nexport declare type AddToSetOperators<Type> = {\n $each?: Array<Flatten<Type>>;\n};\n\n/**\n * The **Admin** class is an internal class that allows convenient access to\n * the admin functionality and commands for MongoDB.\n *\n * **ADMIN Cannot directly be instantiated**\n * @public\n *\n * @example\n * ```ts\n * import { MongoClient } from '/mongodb.ts';\n *\n * const client = new MongoClient('mongodb://localhost:27017');\n * const admin = client.db().admin();\n * const dbInfo = await admin.listDatabases();\n * for (const db of dbInfo.databases) {\n * console.log(db.name);\n * }\n * ```\n */\nexport declare class Admin {\n /* Excluded from this release type: s */\n /* Excluded from this release type: __constructor */\n /**\n * Execute a command\n *\n * The driver will ensure the following fields are attached to the command sent to the server:\n * - `lsid` - sourced from an implicit session or options.session\n * - `$readPreference` - defaults to primary or can be configured by options.readPreference\n * - `$db` - sourced from the name of this database\n *\n * If the client has a serverApi setting:\n * - `apiVersion`\n * - `apiStrict`\n * - `apiDeprecationErrors`\n *\n * When in a transaction:\n * - `readConcern` - sourced from readConcern set on the TransactionOptions\n * - `writeConcern` - sourced from writeConcern set on the TransactionOptions\n *\n * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value.\n *\n * @param command - The command to execute\n * @param options - Optional settings for the command\n */\n command(command: Document, options?: RunCommandOptions): Promise<Document>;\n /**\n * Retrieve the server build information\n *\n * @param options - Optional settings for the command\n */\n buildInfo(options?: CommandOperationOptions): Promise<Document>;\n /**\n * Retrieve the server build information\n *\n * @param options - Optional settings for the command\n */\n serverInfo(options?: CommandOperationOptions): Promise<Document>;\n /**\n * Retrieve this db's server status.\n *\n * @param options - Optional settings for the command\n */\n serverStatus(options?: CommandOperationOptions): Promise<Document>;\n /**\n * Ping the MongoDB server and retrieve results\n *\n * @param options - Optional settings for the command\n */\n ping(options?: CommandOperationOptions): Promise<Document>;\n /**\n * Remove a user from a database\n *\n * @param username - The username to remove\n * @param options - Optional settings for the command\n */\n removeUser(username: string, options?: RemoveUserOptions): Promise<boolean>;\n /**\n * Validate an existing collection\n *\n * @param collectionName - The name of the collection to validate.\n * @param options - Optional settings for the command\n */\n validateCollection(collectionName: string, options?: ValidateCollectionOptions): Promise<Document>;\n /**\n * List the available databases\n *\n * @param options - Optional settings for the command\n */\n listDatabases(options?: ListDatabasesOptions): Promise<ListDatabasesResult>;\n /**\n * Get ReplicaSet status\n *\n * @param options - Optional settings for the command\n */\n replSetGetStatus(options?: CommandOperationOptions): Promise<Document>;\n}\n\n/* Excluded from this release type: AdminPrivate */\n\n/* Excluded from this release type: AggregateOperation */\n\n/** @public */\nexport declare interface AggregateOptions extends Omit<CommandOperationOptions, 'explain'> {\n /** allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 \\>). */\n allowDiskUse?: boolean;\n /** The number of documents to return per batch. See [aggregation documentation](https://www.mongodb.com/docs/manual/reference/command/aggregate). */\n batchSize?: number;\n /** Allow driver to bypass schema validation. */\n bypassDocumentValidation?: boolean;\n /** Return the query as cursor, on 2.6 \\> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */\n cursor?: Document;\n /**\n * Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.\n */\n maxTimeMS?: number;\n /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */\n maxAwaitTimeMS?: number;\n /** Specify collation. */\n collation?: CollationOptions;\n /** Add an index selection hint to an aggregation command */\n hint?: Hint;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n out?: string;\n /**\n * Specifies the verbosity mode for the explain output.\n * @deprecated This API is deprecated in favor of `collection.aggregate().explain()`\n * or `db.aggregate().explain()`.\n */\n explain?: ExplainOptions['explain'];\n /* Excluded from this release type: timeoutMode */\n}\n\n/**\n * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB\n * allowing for iteration over the results returned from the underlying query. It supports\n * one by one document iteration, conversion to an array or can be iterated as a Node 4.X\n * or higher stream\n * @public\n */\nexport declare class AggregationCursor<TSchema = any> extends ExplainableCursor<TSchema> {\n readonly pipeline: Document[];\n /* Excluded from this release type: aggregateOptions */\n /* Excluded from this release type: __constructor */\n clone(): AggregationCursor<TSchema>;\n map<T>(transform: (doc: TSchema) => T): AggregationCursor<T>;\n /* Excluded from this release type: _initialize */\n /** Execute the explain for the cursor */\n explain(): Promise<Document>;\n explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise<Document>;\n explain(options: {\n timeoutMS?: number;\n }): Promise<Document>;\n explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: {\n timeoutMS?: number;\n }): Promise<Document>;\n /** Add a stage to the aggregation pipeline\n * @example\n * ```\n * const documents = await users.aggregate().addStage({ $match: { name: /Mike/ } }).toArray();\n * ```\n * @example\n * ```\n * const documents = await users.aggregate()\n * .addStage<{ name: string }>({ $project: { name: true } })\n * .toArray(); // type of documents is { name: string }[]\n * ```\n */\n addStage(stage: Document): this;\n addStage<T = Document>(stage: Document): AggregationCursor<T>;\n /** Add a group stage to the aggregation pipeline */\n group<T = TSchema>($group: Document): AggregationCursor<T>;\n /** Add a limit stage to the aggregation pipeline */\n limit($limit: number): this;\n /** Add a match stage to the aggregation pipeline */\n match($match: Document): this;\n /** Add an out stage to the aggregation pipeline */\n out($out: {\n db: string;\n coll: string;\n } | string): this;\n /**\n * Add a project stage to the aggregation pipeline\n *\n * @remarks\n * In order to strictly type this function you must provide an interface\n * that represents the effect of your projection on the result documents.\n *\n * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type.\n * You should specify a parameterized type to have assertions on your final results.\n *\n * @example\n * ```typescript\n * // Best way\n * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true });\n * // Flexible way\n * const docs: AggregationCursor<Document> = cursor.project({ _id: 0, a: true });\n * ```\n *\n * @remarks\n * In order to strictly type this function you must provide an interface\n * that represents the effect of your projection on the result documents.\n *\n * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor,\n * it **does not** return a new instance of a cursor. This means when calling project,\n * you should always assign the result to a new variable in order to get a correctly typed cursor variable.\n * Take note of the following example:\n *\n * @example\n * ```typescript\n * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]);\n * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true });\n * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray();\n *\n * // or always use chaining and save the final cursor\n *\n * const cursor = coll.aggregate().project<{ a: string }>({\n * _id: 0,\n * a: { $convert: { input: '$a', to: 'string' }\n * }});\n * ```\n */\n project<T extends Document = Document>($project: Document): AggregationCursor<T>;\n /** Add a lookup stage to the aggregation pipeline */\n lookup($lookup: Document): this;\n /** Add a redact stage to the aggregation pipeline */\n redact($redact: Document): this;\n /** Add a skip stage to the aggregation pipeline */\n skip($skip: number): this;\n /** Add a sort stage to the aggregation pipeline */\n sort($sort: Sort): this;\n /** Add a unwind stage to the aggregation pipeline */\n unwind($unwind: Document | string): this;\n /** Add a geoNear stage to the aggregation pipeline */\n geoNear($geoNear: Document): this;\n}\n\n/** @public */\nexport declare interface AggregationCursorOptions extends AbstractCursorOptions, AggregateOptions {\n}\n\n/**\n * It is possible to search using alternative types in mongodb e.g.\n * string types can be searched using a regex in mongo\n * array types can be searched using their element type\n * @public\n */\nexport declare type AlternativeType<T> = T extends ReadonlyArray<infer U> ? T | RegExpOrString<U> : RegExpOrString<T>;\n\n/** @public */\nexport declare type AnyBulkWriteOperation<TSchema extends Document = Document> = {\n insertOne: InsertOneModel<TSchema>;\n} | {\n replaceOne: ReplaceOneModel<TSchema>;\n} | {\n updateOne: UpdateOneModel<TSchema>;\n} | {\n updateMany: UpdateManyModel<TSchema>;\n} | {\n deleteOne: DeleteOneModel<TSchema>;\n} | {\n deleteMany: DeleteManyModel<TSchema>;\n};\n\n/**\n * Used to represent any of the client bulk write models that can be passed as an array\n * to MongoClient#bulkWrite.\n * @public\n */\nexport declare type AnyClientBulkWriteModel<TSchema extends Document> = ClientInsertOneModel<TSchema> | ClientReplaceOneModel<TSchema> | ClientUpdateOneModel<TSchema> | ClientUpdateManyModel<TSchema> | ClientDeleteOneModel<TSchema> | ClientDeleteManyModel<TSchema>;\n\n/** @public */\nexport declare type AnyError = MongoError | Error;\n\n/** @public */\nexport declare type ArrayElement<Type> = Type extends ReadonlyArray<infer Item> ? Item : never;\n\n/** @public */\nexport declare type ArrayOperator<Type> = {\n $each?: Array<Flatten<Type>>;\n $slice?: number;\n $position?: number;\n $sort?: Sort;\n};\n\n/**\n * @public\n */\ndeclare interface AsyncDisposable_2 {\n /* Excluded from this release type: [Symbol.asyncDispose] */\n /* Excluded from this release type: asyncDispose */\n}\nexport { AsyncDisposable_2 as AsyncDisposable }\n\n/** @public */\nexport declare interface Auth {\n /** The username for auth */\n username?: string;\n /** The password for auth */\n password?: string;\n}\n\n/* Excluded from this release type: AuthContext */\n\n/** @public */\nexport declare const AuthMechanism: Readonly<{\n readonly MONGODB_AWS: \"MONGODB-AWS\";\n readonly MONGODB_CR: \"MONGODB-CR\";\n readonly MONGODB_DEFAULT: \"DEFAULT\";\n readonly MONGODB_GSSAPI: \"GSSAPI\";\n readonly MONGODB_PLAIN: \"PLAIN\";\n readonly MONGODB_SCRAM_SHA1: \"SCRAM-SHA-1\";\n readonly MONGODB_SCRAM_SHA256: \"SCRAM-SHA-256\";\n readonly MONGODB_X509: \"MONGODB-X509\";\n readonly MONGODB_OIDC: \"MONGODB-OIDC\";\n}>;\n\n/** @public */\nexport declare type AuthMechanism = (typeof AuthMechanism)[keyof typeof AuthMechanism];\n\n/** @public */\nexport declare interface AuthMechanismProperties extends Document {\n SERVICE_HOST?: string;\n SERVICE_NAME?: string;\n SERVICE_REALM?: string;\n CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue;\n AWS_SESSION_TOKEN?: string;\n /** A user provided OIDC machine callback function. */\n OIDC_CALLBACK?: OIDCCallbackFunction;\n /** A user provided OIDC human interacted callback function. */\n OIDC_HUMAN_CALLBACK?: OIDCCallbackFunction;\n /** The OIDC environment. Note that 'test' is for internal use only. */\n ENVIRONMENT?: 'test' | 'azure' | 'gcp' | 'k8s';\n /** Allowed hosts that OIDC auth can connect to. */\n ALLOWED_HOSTS?: string[];\n /** The resource token for OIDC auth in Azure and GCP. */\n TOKEN_RESOURCE?: string;\n /**\n * A custom AWS credential provider to use. An example using the AWS SDK default provider chain:\n *\n * ```ts\n * const client = new MongoClient(process.env.MONGODB_URI, {\n * authMechanismProperties: {\n * AWS_CREDENTIAL_PROVIDER: fromNodeProviderChain()\n * }\n * });\n * ```\n *\n * Using a custom function that returns AWS credentials:\n *\n * ```ts\n * const client = new MongoClient(process.env.MONGODB_URI, {\n * authMechanismProperties: {\n * AWS_CREDENTIAL_PROVIDER: async () => {\n * return {\n * accessKeyId: process.env.ACCESS_KEY_ID,\n * secretAccessKey: process.env.SECRET_ACCESS_KEY\n * }\n * }\n * }\n * });\n * ```\n */\n AWS_CREDENTIAL_PROVIDER?: AWSCredentialProvider;\n}\n\n/* Excluded from this release type: AuthProvider */\n\n/* Excluded from this release type: AutoEncrypter */\n\n/**\n * @public\n *\n * Extra options related to the mongocryptd process\n * \\* _Available in MongoDB 6.0 or higher._\n */\nexport declare type AutoEncryptionExtraOptions = NonNullable<AutoEncryptionOptions['extraOptions']>;\n\n/** @public */\nexport declare const AutoEncryptionLoggerLevel: Readonly<{\n readonly FatalError: 0;\n readonly Error: 1;\n readonly Warning: 2;\n readonly Info: 3;\n readonly Trace: 4;\n}>;\n\n/**\n * @public\n * The level of severity of the log message\n *\n * | Value | Level |\n * |-------|-------|\n * | 0 | Fatal Error |\n * | 1 | Error |\n * | 2 | Warning |\n * | 3 | Info |\n * | 4 | Trace |\n */\nexport declare type AutoEncryptionLoggerLevel = (typeof AutoEncryptionLoggerLevel)[keyof typeof AutoEncryptionLoggerLevel];\n\n/** @public */\nexport declare interface AutoEncryptionOptions {\n /* Excluded from this release type: metadataClient */\n /** A `MongoClient` used to fetch keys from a key vault */\n keyVaultClient?: MongoClient;\n /** The namespace where keys are stored in the key vault */\n keyVaultNamespace?: string;\n /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */\n kmsProviders?: KMSProviders;\n /** Configuration options for custom credential providers. */\n credentialProviders?: CredentialProviders;\n /**\n * A map of namespaces to a local JSON schema for encryption\n *\n * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server.\n * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted.\n * Schemas supplied in the schemaMap only apply to configuring automatic encryption for Client-Side Field Level Encryption.\n * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error.\n */\n schemaMap?: Document;\n /** Supply a schema for the encrypted fields in the document */\n encryptedFieldsMap?: Document;\n /** Allows the user to bypass auto encryption, maintaining implicit decryption */\n bypassAutoEncryption?: boolean;\n /** Allows users to bypass query analysis */\n bypassQueryAnalysis?: boolean;\n options?: {\n /** An optional hook to catch logging messages from the underlying encryption engine */\n logger?: (level: AutoEncryptionLoggerLevel, message: string) => void;\n };\n extraOptions?: {\n /**\n * A local process the driver communicates with to determine how to encrypt values in a command.\n * Defaults to \"mongodb://%2Fvar%2Fmongocryptd.sock\" if domain sockets are available or \"mongodb://localhost:27020\" otherwise\n */\n mongocryptdURI?: string;\n /** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */\n mongocryptdBypassSpawn?: boolean;\n /** The path to the mongocryptd executable on the system */\n mongocryptdSpawnPath?: string;\n /** Command line arguments to use when auto-spawning a mongocryptd */\n mongocryptdSpawnArgs?: string[];\n /**\n * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd).\n *\n * This needs to be the path to the file itself, not a directory.\n * It can be an absolute or relative path. If the path is relative and\n * its first component is `$ORIGIN`, it will be replaced by the directory\n * containing the mongodb-client-encryption native addon file. Otherwise,\n * the path will be interpreted relative to the current working directory.\n *\n * Currently, loading different MongoDB Crypt shared library files from different\n * MongoClients in the same process is not supported.\n *\n * If this option is provided and no MongoDB Crypt shared library could be loaded\n * from the specified location, creating the MongoClient will fail.\n *\n * If this option is not provided and `cryptSharedLibRequired` is not specified,\n * the AutoEncrypter will attempt to spawn and/or use mongocryptd according\n * to the mongocryptd-specific `extraOptions` options.\n *\n * Specifying a path prevents mongocryptd from being used as a fallback.\n *\n * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher.\n */\n cryptSharedLibPath?: string;\n /**\n * If specified, never use mongocryptd and instead fail when the MongoDB Crypt\n * shared library could not be loaded.\n *\n * This is always true when `cryptSharedLibPath` is specified.\n *\n * Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher.\n */\n cryptSharedLibRequired?: boolean;\n /* Excluded from this release type: cryptSharedLibSearchPaths */\n };\n proxyOptions?: ProxyOptions;\n /** The TLS options to use connecting to the KMS provider */\n tlsOptions?: CSFLEKMSTlsOptions;\n}\n\n/** @public **/\nexport declare type AWSCredentialProvider = () => Promise<AWSCredentials>;\n\n/**\n * @public\n * Copy of the AwsCredentialIdentityProvider interface from [`smithy/types`](https://socket.dev/npm/package/\\@smithy/types/files/1.1.1/dist-types/identity/awsCredentialIdentity.d.ts),\n * the return type of the aws-sdk's `fromNodeProviderChain().provider()`.\n */\nexport declare interface AWSCredentials {\n accessKeyId: string;\n secretAccessKey: string;\n sessionToken?: string;\n expiration?: Date;\n}\n\n/**\n * @public\n * Configuration options for making an AWS encryption key\n */\nexport declare interface AWSEncryptionKeyOptions {\n /**\n * The AWS region of the KMS\n */\n region: string;\n /**\n * The Amazon Resource Name (ARN) to the AWS customer master key (CMK)\n */\n key: string;\n /**\n * An alternate host to send KMS requests to. May include port number.\n */\n endpoint?: string | undefined;\n}\n\n/** @public */\nexport declare interface AWSKMSProviderConfiguration {\n /**\n * The access key used for the AWS KMS provider\n */\n accessKeyId: string;\n /**\n * The secret access key used for the AWS KMS provider\n */\n secretAccessKey: string;\n /**\n * An optional AWS session token that will be used as the\n * X-Amz-Security-Token header for AWS requests.\n */\n sessionToken?: string;\n}\n\n/**\n * @public\n * Configuration options for making an Azure encryption key\n */\nexport declare interface AzureEncryptionKeyOptions {\n /**\n * Key name\n */\n keyName: string;\n /**\n * Key vault URL, typically `<name>.vault.azure.net`\n */\n keyVaultEndpoint: string;\n /**\n * Key version\n */\n keyVersion?: string | undefined;\n}\n\n/** @public */\nexport declare type AzureKMSProviderConfiguration = {\n /**\n * The tenant ID identifies the organization for the account\n */\n tenantId: string;\n /**\n * The client ID to authenticate a registered application\n */\n clientId: string;\n /**\n * The client secret to authenticate a registered application\n */\n clientSecret: string;\n /**\n * If present, a host with optional port. E.g. \"example.com\" or \"example.com:443\".\n * This is optional, and only needed if customer is using a non-commercial Azure instance\n * (e.g. a government or China account, which use different URLs).\n * Defaults to \"login.microsoftonline.com\"\n */\n identityPlatformEndpoint?: string | undefined;\n} | {\n /**\n * If present, an access token to authenticate with Azure.\n */\n accessToken: string;\n};\n\n/**\n * Keeps the state of a unordered batch so we can rewrite the results\n * correctly after command execution\n *\n * @public\n */\nexport declare class Batch<T = Document> {\n originalZeroIndex: number;\n currentIndex: number;\n originalIndexes: number[];\n batchType: BatchType;\n operations: T[];\n size: number;\n sizeBytes: number;\n constructor(batchType: BatchType, originalZeroIndex: number);\n}\n\n/** @public */\nexport declare const BatchType: Readonly<{\n readonly INSERT: 1;\n readonly UPDATE: 2;\n readonly DELETE: 3;\n}>;\n\n/** @public */\nexport declare type BatchType = (typeof BatchType)[keyof typeof BatchType];\n\nexport { Binary }\n\n/** @public */\nexport declare type BitwiseFilter = number /** numeric bit mask */ | Binary /** BinData bit mask */ | ReadonlyArray<number>;\n\nexport { BSON }\n\n/* Excluded from this release type: BSONElement */\nexport { BSONRegExp }\n\n/**\n * BSON Serialization options.\n * @public\n */\nexport declare interface BSONSerializeOptions extends Omit<SerializeOptions, 'index'>, Omit<DeserializeOptions, 'evalFunctions' | 'cacheFunctions' | 'cacheFunctionsCrc32' | 'allowObjectSmallerThanBufferSize' | 'index' | 'validation'> {\n /**\n * Enabling the raw option will return a [Node.js Buffer](https://nodejs.org/api/buffer.html)\n * which is allocated using [allocUnsafe API](https://nodejs.org/api/buffer.html#static-method-bufferallocunsafesize).\n * See this section from the [Node.js Docs here](https://nodejs.org/api/buffer.html#what-makes-bufferallocunsafe-and-bufferallocunsafeslow-unsafe)\n * for more detail about what \"unsafe\" refers to in this context.\n * If you need to maintain your own editable clone of the bytes returned for an extended life time of the process, it is recommended you allocate\n * your own buffer and clone the contents:\n *\n * @example\n * ```ts\n * const raw = await collection.findOne({}, { raw: true });\n * const myBuffer = Buffer.alloc(raw.byteLength);\n * myBuffer.set(raw, 0);\n * // Only save and use `myBuffer` beyond this point\n * ```\n *\n * @remarks\n * Please note there is a known limitation where this option cannot be used at the MongoClient level (see [NODE-3946](https://jira.mongodb.org/browse/NODE-3946)).\n * It does correctly work at `Db`, `Collection`, and per operation the same as other BSON options work.\n */\n raw?: boolean;\n /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */\n enableUtf8Validation?: boolean;\n}\n\nexport { BSONSymbol }\n\nexport { BSONType }\n\n/** @public */\nexport declare type BSONTypeAlias = keyof typeof BSONType;\n\n/* Excluded from this release type: BufferPool */\n\n/** @public */\nexport declare abstract class BulkOperationBase {\n private collection;\n isOrdered: boolean;\n /* Excluded from this release type: s */\n operationId?: number;\n /* Excluded from this release type: __constructor */\n /**\n * Add a single insert document to the bulk operation\n *\n * @example\n * ```ts\n * const bulkOp = collection.initializeOrderedBulkOp();\n *\n * // Adds three inserts to the bulkOp.\n * bulkOp\n * .insert({ a: 1 })\n * .insert({ b: 2 })\n * .insert({ c: 3 });\n * await bulkOp.execute();\n * ```\n */\n insert(document: Document): BulkOperationBase;\n /**\n * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne.\n * Returns a builder object used to complete the definition of the operation.\n *\n * @example\n * ```ts\n * const bulkOp = collection.initializeOrderedBulkOp();\n *\n * // Add an updateOne to the bulkOp\n * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } });\n *\n * // Add an updateMany to the bulkOp\n * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } });\n *\n * // Add an upsert\n * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } });\n *\n * // Add a deletion\n * bulkOp.find({ g: 7 }).deleteOne();\n *\n * // Add a multi deletion\n * bulkOp.find({ h: 8 }).delete();\n *\n * // Add a replaceOne\n * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }});\n *\n * // Update using a pipeline (requires Mongodb 4.2 or higher)\n * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([\n * { $set: { total: { $sum: [ '$y', '$z' ] } } }\n * ]);\n *\n * // All of the ops will now be executed\n * await bulkOp.execute();\n * ```\n */\n find(selector: Document): FindOperators;\n /** Specifies a raw operation to perform in the bulk write. */\n raw(op: AnyBulkWriteOperation): this;\n get length(): number;\n get bsonOptions(): BSONSerializeOptions;\n get writeConcern(): WriteConcern | undefined;\n get batches(): Batch[];\n execute(options?: BulkWriteOptions): Promise<BulkWriteResult>;\n /* Excluded from this release type: handleWriteError */\n abstract addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this;\n private shouldForceServerObjectId;\n}\n\n/* Excluded from this release type: BulkOperationPrivate */\n\n/* Excluded from this release type: BulkResult */\n\n/** @public */\nexport declare interface BulkWriteOperationError {\n index: number;\n code: number;\n errmsg: string;\n errInfo: Document;\n op: Document | UpdateStatement | DeleteStatement;\n}\n\n/** @public */\nexport declare interface BulkWriteOptions extends CommandOperationOptions {\n /**\n * Allow driver to bypass schema validation.\n * @defaultValue `false` - documents will be validated by default\n **/\n bypassDocumentValidation?: boolean;\n /**\n * If true, when an insert fails, don't execute the remaining writes.\n * If false, continue with remaining inserts when one fails.\n * @defaultValue `true` - inserts are ordered by default\n */\n ordered?: boolean;\n /**\n * Force server to assign _id values instead of driver.\n * @defaultValue `false` - the driver generates `_id` fields by default\n **/\n forceServerObjectId?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /* Excluded from this release type: timeoutContext */\n}\n\n/**\n * @public\n * The result of a bulk write.\n */\nexport declare class BulkWriteResult {\n private readonly result;\n /** Number of documents inserted. */\n readonly insertedCount: number;\n /** Number of documents matched for update. */\n readonly matchedCount: number;\n /** Number of documents modified. */\n readonly modifiedCount: number;\n /** Number of documents deleted. */\n readonly deletedCount: number;\n /** Number of documents upserted. */\n readonly upsertedCount: number;\n /** Upserted document generated Id's, hash key is the index of the originating operation */\n readonly upsertedIds: {\n [key: number]: any;\n };\n /** Inserted document generated Id's, hash key is the index of the originating operation */\n readonly insertedIds: {\n [key: number]: any;\n };\n private static generateIdMap;\n /* Excluded from this release type: __constructor */\n /** Evaluates to true if the bulk operation correctly executes */\n get ok(): number;\n /* Excluded from this release type: getSuccessfullyInsertedIds */\n /** Returns the upserted id at the given index */\n getUpsertedIdAt(index: number): Document | undefined;\n /** Returns raw internal result */\n getRawResponse(): Document;\n /** Returns true if the bulk operation contains a write error */\n hasWriteErrors(): boolean;\n /** Returns the number of write errors off the bulk operation */\n getWriteErrorCount(): number;\n /** Returns a specific write error object */\n getWriteErrorAt(index: number): WriteError | undefined;\n /** Retrieve all write errors */\n getWriteErrors(): WriteError[];\n /** Retrieve the write concern error if one exists */\n getWriteConcernError(): WriteConcernError | undefined;\n toString(): string;\n isOk(): boolean;\n}\n\n/**\n * MongoDB Driver style callback\n * @public\n */\nexport declare type Callback<T = any> = (error?: AnyError, result?: T) => void;\n\n/** @public */\nexport declare class CancellationToken extends TypedEventEmitter<{\n cancel(): void;\n}> {\n constructor(...args: any[]);\n}\n\n/**\n * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.\n * @public\n */\nexport declare class ChangeStream<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>> extends TypedEventEmitter<ChangeStreamEvents<TSchema, TChange>> implements AsyncDisposable_2 {\n /* Excluded from this release type: [Symbol.asyncDispose] */\n /* Excluded from this release type: asyncDispose */\n pipeline: Document[];\n /**\n * @remarks WriteConcern can still be present on the options because\n * we inherit options from the client/db/collection. The\n * key must be present on the options in order to delete it.\n * This allows typescript to delete the key but will\n * not allow a writeConcern to be assigned as a property on options.\n */\n options: ChangeStreamOptions & {\n writeConcern?: never;\n };\n parent: MongoClient | Db | Collection;\n namespace: MongoDBNamespace;\n type: symbol;\n /* Excluded from this release type: cursor */\n streamOptions?: CursorStreamOptions;\n /* Excluded from this release type: cursorStream */\n /* Excluded from this release type: isClosed */\n /* Excluded from this release type: mode */\n /** @event */\n static readonly RESPONSE: \"response\";\n /** @event */\n static readonly MORE: \"more\";\n /** @event */\n static readonly INIT: \"init\";\n /** @event */\n static readonly CLOSE: \"close\";\n /**\n * Fired for each new matching change in the specified namespace. Attaching a `change`\n * event listener to a Change Stream will switch the stream into flowing mode. Data will\n * then be passed as soon as it is available.\n * @event\n */\n static readonly CHANGE: \"change\";\n /** @event */\n static readonly END: \"end\";\n /** @event */\n static readonly ERROR: \"error\";\n /**\n * Emitted each time the change stream stores a new resume token.\n * @event\n */\n static readonly RESUME_TOKEN_CHANGED: \"resumeTokenChanged\";\n private timeoutContext?;\n /**\n * Note that this property is here to uniquely identify a ChangeStream instance as the owner of\n * the {@link CursorTimeoutContext} instance (see {@link ChangeStream._createChangeStreamCursor}) to ensure\n * that {@link AbstractCursor.close} does not mutate the timeoutContext.\n */\n private contextOwner;\n /* Excluded from this release type: __constructor */\n /** The cached resume token that is used to resume after the most recently returned change. */\n get resumeToken(): ResumeToken;\n /** Check if there is any document still available in the Change Stream */\n hasNext(): Promise<boolean>;\n /** Get the next available document from the Change Stream. */\n next(): Promise<TChange>;\n /**\n * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned\n */\n tryNext(): Promise<TChange | null>;\n [Symbol.asyncIterator](): AsyncGenerator<TChange, void, void>;\n /** Is the cursor closed */\n get closed(): boolean;\n /**\n * Frees the internal resources used by the change stream.\n */\n close(): Promise<void>;\n /**\n * Return a modified Readable stream including a possible transform method.\n *\n * NOTE: When using a Stream to process change stream events, the stream will\n * NOT automatically resume in the case a resumable error is encountered.\n *\n * @throws MongoChangeStreamError if the underlying cursor or the change stream is closed\n */\n stream(options?: CursorStreamOptions): Readable & AsyncIterable<TChange>;\n /* Excluded from this release type: _setIsEmitter */\n /* Excluded from this release type: _setIsIterator */\n /* Excluded from this release type: _createChangeStreamCursor */\n /* Excluded from this release type: _closeEmitterModeWithError */\n /* Excluded from this release type: _streamEvents */\n /* Excluded from this release type: _endStream */\n /* Excluded from this release type: _processChange */\n /* Excluded from this release type: _processErrorStreamMode */\n /* Excluded from this release type: _processErrorIteratorMode */\n private _resume;\n}\n\n/**\n * Only present when the `showExpandedEvents` flag is enabled.\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/modify/#mongodb-data-modify\n */\nexport declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'modify';\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/create/#mongodb-data-create\n */\nexport declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'create';\n /**\n * The type of the newly created object.\n *\n * @sinceServerVersion 8.1.0\n */\n nsType?: 'collection' | 'timeseries' | 'view';\n}\n\n/**\n * Only present when the `showExpandedEvents` flag is enabled.\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/createIndexes/#mongodb-data-createIndexes\n */\nexport declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {\n /** Describes the type of operation represented in this change notification */\n operationType: 'createIndexes';\n}\n\n/* Excluded from this release type: ChangeStreamCursor */\n\n/* Excluded from this release type: ChangeStreamCursorOptions */\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event\n */\nexport declare interface ChangeStreamDeleteDocument<TSchema extends Document = Document> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'delete';\n /** Namespace the delete event occurred on */\n ns: ChangeStreamNameSpace;\n /**\n * Contains the pre-image of the modified or deleted document if the\n * pre-image is available for the change event and either 'required' or\n * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option\n * when creating the change stream. If 'whenAvailable' was specified but the\n * pre-image is unavailable, this will be explicitly set to null.\n */\n fullDocumentBeforeChange?: TSchema;\n}\n\n/** @public */\nexport declare type ChangeStreamDocument<TSchema extends Document = Document> = ChangeStreamInsertDocument<TSchema> | ChangeStreamUpdateDocument<TSchema> | ChangeStreamReplaceDocument<TSchema> | ChangeStreamDeleteDocument<TSchema> | ChangeStreamDropDocument | ChangeStreamRenameDocument | ChangeStreamDropDatabaseDocument | ChangeStreamInvalidateDocument | ChangeStreamCreateIndexDocument | ChangeStreamCreateDocument | ChangeStreamCollModDocument | ChangeStreamDropIndexDocument | ChangeStreamShardCollectionDocument | ChangeStreamReshardCollectionDocument | ChangeStreamRefineCollectionShardKeyDocument;\n\n/** @public */\nexport declare interface ChangeStreamDocumentCollectionUUID {\n /**\n * The UUID (Binary subtype 4) of the collection that the operation was performed on.\n *\n * Only present when the `showExpandedEvents` flag is enabled.\n *\n * **NOTE:** collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers\n * flag is enabled.\n *\n * @sinceServerVersion 6.1.0\n */\n collectionUUID: Binary;\n}\n\n/** @public */\nexport declare interface ChangeStreamDocumentCommon {\n /**\n * The id functions as an opaque token for use when resuming an interrupted\n * change stream.\n */\n _id: ResumeToken;\n /**\n * The timestamp from the oplog entry associated with the event.\n * For events that happened as part of a multi-document transaction, the associated change stream\n * notifications will have the same clusterTime value, namely the time when the transaction was committed.\n * On a sharded cluster, events that occur on different shards can have the same clusterTime but be\n * associated with different transactions or even not be associated with any transaction.\n * To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.\n */\n clusterTime?: Timestamp;\n /**\n * The transaction number.\n * Only present if the operation is part of a multi-document transaction.\n *\n * **NOTE:** txnNumber can be a Long if promoteLongs is set to false\n */\n txnNumber?: number;\n /**\n * The identifier for the session associated with the transaction.\n * Only present if the operation is part of a multi-document transaction.\n */\n lsid?: ServerSessionId;\n /**\n * When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent\n * stage, events larger than 16MB will be split into multiple events and contain the\n * following information about which fragment the current event is.\n */\n splitEvent?: ChangeStreamSplitEvent;\n}\n\n/** @public */\nexport declare interface ChangeStreamDocumentKey<TSchema extends Document = Document> {\n /**\n * For unsharded collections this contains a single field `_id`.\n * For sharded collections, this will contain all the components of the shard key\n */\n documentKey: {\n _id: InferIdType<TSchema>;\n [shardKey: string]: any;\n };\n}\n\n/** @public */\nexport declare interface ChangeStreamDocumentOperationDescription {\n /**\n * An description of the operation.\n *\n * Only present when the `showExpandedEvents` flag is enabled.\n *\n * @sinceServerVersion 6.1.0\n */\n operationDescription?: Document;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event\n */\nexport declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon {\n /** Describes the type of operation represented in this change notification */\n operationType: 'dropDatabase';\n /** The database dropped */\n ns: {\n db: string;\n };\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event\n */\nexport declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'drop';\n /** Namespace the drop event occurred on */\n ns: ChangeStreamNameSpace;\n}\n\n/**\n * Only present when the `showExpandedEvents` flag is enabled.\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/dropIndexes/#mongodb-data-dropIndexes\n */\nexport declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {\n /** Describes the type of operation represented in this change notification */\n operationType: 'dropIndexes';\n}\n\n/** @public */\nexport declare type ChangeStreamEvents<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>> = {\n resumeTokenChanged(token: ResumeToken): void;\n init(response: any): void;\n more(response?: any): void;\n response(): void;\n end(): void;\n error(error: Error): void;\n change(change: TChange): void;\n /**\n * @remarks Note that the `close` event is currently emitted whenever the internal `ChangeStreamCursor`\n * instance is closed, which can occur multiple times for a given `ChangeStream` instance.\n *\n * TODO(NODE-6434): address this issue in NODE-6434\n */\n close(): void;\n};\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event\n */\nexport declare interface ChangeStreamInsertDocument<TSchema extends Document = Document> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'insert';\n /** This key will contain the document being inserted */\n fullDocument: TSchema;\n /** Namespace the insert event occurred on */\n ns: ChangeStreamNameSpace;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event\n */\nexport declare interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon {\n /** Describes the type of operation represented in this change notification */\n operationType: 'invalidate';\n}\n\n/** @public */\nexport declare interface ChangeStreamNameSpace {\n db: string;\n coll: string;\n}\n\n/**\n * Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified.\n * @public\n */\nexport declare interface ChangeStreamOptions extends Omit<AggregateOptions, 'writeConcern'> {\n /**\n * Allowed values: 'updateLookup', 'whenAvailable', 'required'.\n *\n * When set to 'updateLookup', the change notification for partial updates\n * will include both a delta describing the changes to the document as well\n * as a copy of the entire document that was changed from some time after\n * the change occurred.\n *\n * When set to 'whenAvailable', configures the change stream to return the\n * post-image of the modified document for replace and update change events\n * if the post-image for this event is available.\n *\n * When set to 'required', the same behavior as 'whenAvailable' except that\n * an error is raised if the post-image is not available.\n */\n fullDocument?: string;\n /**\n * Allowed values: 'whenAvailable', 'required', 'off'.\n *\n * The default is to not send a value, which is equivalent to 'off'.\n *\n * When set to 'whenAvailable', configures the change stream to return the\n * pre-image of the modified document for replace, update, and delete change\n * events if it is available.\n *\n * When set to 'required', the same behavior as 'whenAvailable' except that\n * an error is raised if the pre-image is not available.\n */\n fullDocumentBeforeChange?: string;\n /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */\n maxAwaitTimeMS?: number;\n /**\n * Allows you to start a changeStream after a specified event.\n * @see https://www.mongodb.com/docs/manual/changeStreams/#resumeafter-for-change-streams\n */\n resumeAfter?: ResumeToken;\n /**\n * Similar to resumeAfter, but will allow you to start after an invalidated event.\n * @see https://www.mongodb.com/docs/manual/changeStreams/#startafter-for-change-streams\n */\n startAfter?: ResumeToken;\n /** Will start the changeStream after the specified operationTime. */\n startAtOperationTime?: OperationTime;\n /**\n * The number of documents to return per batch.\n * @see https://www.mongodb.com/docs/manual/reference/command/aggregate\n */\n batchSize?: number;\n /**\n * When enabled, configures the change stream to include extra change events.\n *\n * - createIndexes\n * - dropIndexes\n * - modify\n * - create\n * - shardCollection\n * - reshardCollection\n * - refineCollectionShardKey\n */\n showExpandedEvents?: boolean;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey/#mongodb-data-refineCollectionShardKey\n */\nexport declare interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {\n /** Describes the type of operation represented in this change notification */\n operationType: 'refineCollectionShardKey';\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event\n */\nexport declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'rename';\n /** The new name for the `ns.coll` collection */\n to: {\n db: string;\n coll: string;\n };\n /** The \"from\" namespace that the rename occurred on */\n ns: ChangeStreamNameSpace;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event\n */\nexport declare interface ChangeStreamReplaceDocument<TSchema extends Document = Document> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema> {\n /** Describes the type of operation represented in this change notification */\n operationType: 'replace';\n /** The fullDocument of a replace event represents the document after the insert of the replacement document */\n fullDocument: TSchema;\n /** Namespace the replace event occurred on */\n ns: ChangeStreamNameSpace;\n /**\n * Contains the pre-image of the modified or deleted document if the\n * pre-image is available for the change event and either 'required' or\n * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option\n * when creating the change stream. If 'whenAvailable' was specified but the\n * pre-image is unavailable, this will be explicitly set to null.\n */\n fullDocumentBeforeChange?: TSchema;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/reshardCollection/#mongodb-data-reshardCollection\n */\nexport declare interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {\n /** Describes the type of operation represented in this change notification */\n operationType: 'reshardCollection';\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/shardCollection/#mongodb-data-shardCollection\n */\nexport declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription {\n /** Describes the type of operation represented in this change notification */\n operationType: 'shardCollection';\n}\n\n/** @public */\nexport declare interface ChangeStreamSplitEvent {\n /** Which fragment of the change this is. */\n fragment: number;\n /** The total number of fragments. */\n of: number;\n}\n\n/**\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event\n */\nexport declare interface ChangeStreamUpdateDocument<TSchema extends Document = Document> extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey<TSchema>, ChangeStreamDocumentCollectionUUID {\n /** Describes the type of operation represented in this change notification */\n operationType: 'update';\n /**\n * This is only set if `fullDocument` is set to `'updateLookup'`\n * Contains the point-in-time post-image of the modified document if the\n * post-image is available and either 'required' or 'whenAvailable' was\n * specified for the 'fullDocument' option when creating the change stream.\n */\n fullDocument?: TSchema;\n /** Contains a description of updated and removed fields in this operation */\n updateDescription: UpdateDescription<TSchema>;\n /** Namespace the update event occurred on */\n ns: ChangeStreamNameSpace;\n /**\n * Contains the pre-image of the modified or deleted document if the\n * pre-image is available for the change event and either 'required' or\n * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option\n * when creating the change stream. If 'whenAvailable' was specified but the\n * pre-image is unavailable, this will be explicitly set to null.\n */\n fullDocumentBeforeChange?: TSchema;\n}\n\n/** @public */\nexport declare interface ClientBulkWriteError {\n code: number;\n message: string;\n}\n\n/**\n * A mapping of namespace strings to collections schemas.\n * @public\n *\n * @example\n * ```ts\n * type MongoDBSchemas = {\n * 'db.books': Book;\n * 'db.authors': Author;\n * }\n *\n * const model: ClientBulkWriteModel<MongoDBSchemas> = {\n * namespace: 'db.books'\n * name: 'insertOne',\n * document: { title: 'Practical MongoDB Aggregations', authorName: 3 } // error `authorName` cannot be number\n * };\n * ```\n *\n * The type of the `namespace` field narrows other parts of the BulkWriteModel to use the correct schema for type assertions.\n *\n */\nexport declare type ClientBulkWriteModel<SchemaMap extends Record<string, Document> = Record<string, Document>> = {\n [Namespace in keyof SchemaMap]: AnyClientBulkWriteModel<SchemaMap[Namespace]> & {\n namespace: Namespace;\n };\n}[keyof SchemaMap];\n\n/** @public */\nexport declare interface ClientBulkWriteOptions extends CommandOperationOptions {\n /**\n * If true, when an insert fails, don't execute the remaining writes.\n * If false, continue with remaining inserts when one fails.\n * @defaultValue `true` - inserts are ordered by default\n */\n ordered?: boolean;\n /**\n * Allow driver to bypass schema validation.\n * @defaultValue `false` - documents will be validated by default\n **/\n bypassDocumentValidation?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /**\n * Whether detailed results for each successful operation should be included in the returned\n * BulkWriteResult.\n */\n verboseResults?: boolean;\n}\n\n/** @public */\nexport declare interface ClientBulkWriteResult {\n /**\n * Whether the bulk write was acknowledged.\n */\n readonly acknowledged: boolean;\n /**\n * The total number of documents inserted across all insert operations.\n */\n readonly insertedCount: number;\n /**\n * The total number of documents upserted across all update operations.\n */\n readonly upsertedCount: number;\n /**\n * The total number of documents matched across all update operations.\n */\n readonly matchedCount: number;\n /**\n * The total number of documents modified across all update operations.\n */\n readonly modifiedCount: number;\n /**\n * The total number of documents deleted across all delete operations.\n */\n readonly deletedCount: number;\n /**\n * The results of each individual insert operation that was successfully performed.\n */\n readonly insertResults?: ReadonlyMap<number, ClientInsertOneResult>;\n /**\n * The results of each individual update operation that was successfully performed.\n */\n readonly updateResults?: ReadonlyMap<number, ClientUpdateResult>;\n /**\n * The results of each individual delete operation that was successfully performed.\n */\n readonly deleteResults?: ReadonlyMap<number, ClientDeleteResult>;\n}\n\n/** @public */\nexport declare interface ClientDeleteManyModel<TSchema> extends ClientWriteModel {\n name: 'deleteMany';\n /**\n * The filter used to determine if a document should be deleted.\n * For a deleteMany operation, all matches are removed.\n */\n filter: Filter<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n}\n\n/** @public */\nexport declare interface ClientDeleteOneModel<TSchema> extends ClientWriteModel {\n name: 'deleteOne';\n /**\n * The filter used to determine if a document should be deleted.\n * For a deleteOne operation, the first match is removed.\n */\n filter: Filter<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n}\n\n/** @public */\nexport declare interface ClientDeleteResult {\n /**\n * The number of documents that were deleted.\n */\n deletedCount: number;\n}\n\n/**\n * @public\n * The public interface for explicit in-use encryption\n */\nexport declare class ClientEncryption {\n /* Excluded from this release type: _client */\n /* Excluded from this release type: _keyVaultNamespace */\n /* Excluded from this release type: _keyVaultClient */\n /* Excluded from this release type: _proxyOptions */\n /* Excluded from this release type: _tlsOptions */\n /* Excluded from this release type: _kmsProviders */\n /* Excluded from this release type: _timeoutMS */\n /* Excluded from this release type: _mongoCrypt */\n /* Excluded from this release type: _credentialProviders */\n /* Excluded from this release type: getMongoCrypt */\n /**\n * Create a new encryption instance\n *\n * @example\n * ```ts\n * new ClientEncryption(mongoClient, {\n * keyVaultNamespace: 'client.encryption',\n * kmsProviders: {\n * local: {\n * key: masterKey // The master key used for encryption/decryption. A 96-byte long Buffer\n * }\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * new ClientEncryption(mongoClient, {\n * keyVaultNamespace: 'client.encryption',\n * kmsProviders: {\n * aws: {\n * accessKeyId: AWS_ACCESS_KEY,\n * secretAccessKey: AWS_SECRET_KEY\n * }\n * }\n * });\n * ```\n */\n constructor(client: MongoClient, options: ClientEncryptionOptions);\n /**\n * Creates a data key used for explicit encryption and inserts it into the key vault namespace\n *\n * @example\n * ```ts\n * // Using async/await to create a local key\n * const dataKeyId = await clientEncryption.createDataKey('local');\n * ```\n *\n * @example\n * ```ts\n * // Using async/await to create an aws key\n * const dataKeyId = await clientEncryption.createDataKey('aws', {\n * masterKey: {\n * region: 'us-east-1',\n * key: 'xxxxxxxxxxxxxx' // CMK ARN here\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Using async/await to create an aws key with a keyAltName\n * const dataKeyId = await clientEncryption.createDataKey('aws', {\n * masterKey: {\n * region: 'us-east-1',\n * key: 'xxxxxxxxxxxxxx' // CMK ARN here\n * },\n * keyAltNames: [ 'mySpecialKey' ]\n * });\n * ```\n */\n createDataKey(provider: ClientEncryptionDataKeyProvider, options?: ClientEncryptionCreateDataKeyProviderOptions): Promise<UUID>;\n /**\n * Searches the keyvault for any data keys matching the provided filter. If there are matches, rewrapManyDataKey then attempts to re-wrap the data keys using the provided options.\n *\n * If no matches are found, then no bulk write is performed.\n *\n * @example\n * ```ts\n * // rewrapping all data data keys (using a filter that matches all documents)\n * const filter = {};\n *\n * const result = await clientEncryption.rewrapManyDataKey(filter);\n * if (result.bulkWriteResult != null) {\n * // keys were re-wrapped, results will be available in the bulkWrite object.\n * }\n * ```\n *\n * @example\n * ```ts\n * // attempting to rewrap all data keys with no matches\n * const filter = { _id: new Binary() } // assume _id matches no documents in the database\n * const result = await clientEncryption.rewrapManyDataKey(filter);\n *\n * if (result.bulkWriteResult == null) {\n * // no keys matched, `bulkWriteResult` does not exist on the result object\n * }\n * ```\n */\n rewrapManyDataKey(filter: Filter<DataKey>, options: ClientEncryptionRewrapManyDataKeyProviderOptions): Promise<{\n bulkWriteResult?: BulkWriteResult;\n }>;\n /**\n * Deletes the key with the provided id from the keyvault, if it exists.\n *\n * @example\n * ```ts\n * // delete a key by _id\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const { deletedCount } = await clientEncryption.deleteKey(id);\n *\n * if (deletedCount != null && deletedCount > 0) {\n * // successful deletion\n * }\n * ```\n *\n */\n deleteKey(_id: Binary): Promise<DeleteResult>;\n /**\n * Finds all the keys currently stored in the keyvault.\n *\n * This method will not throw.\n *\n * @returns a FindCursor over all keys in the keyvault.\n * @example\n * ```ts\n * // fetching all keys\n * const keys = await clientEncryption.getKeys().toArray();\n * ```\n */\n getKeys(): FindCursor<DataKey>;\n /**\n * Finds a key in the keyvault with the specified _id.\n *\n * Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // getting a key by id\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const key = await clientEncryption.getKey(id);\n * if (!key) {\n * // key is null if there was no matching key\n * }\n * ```\n */\n getKey(_id: Binary): Promise<DataKey | null>;\n /**\n * Finds a key in the keyvault which has the specified keyAltName.\n *\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the keyAltName. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // get a key by alt name\n * const keyAltName = 'keyAltName';\n * const key = await clientEncryption.getKeyByAltName(keyAltName);\n * if (!key) {\n * // key is null if there is no matching key\n * }\n * ```\n */\n getKeyByAltName(keyAltName: string): Promise<WithId<DataKey> | null>;\n /**\n * Adds a keyAltName to a key identified by the provided _id.\n *\n * This method resolves to/returns the *old* key value (prior to adding the new altKeyName).\n *\n * @param _id - The id of the document to update.\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // adding an keyAltName to a data key\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const keyAltName = 'keyAltName';\n * const oldKey = await clientEncryption.addKeyAltName(id, keyAltName);\n * if (!oldKey) {\n * // null is returned if there is no matching document with an id matching the supplied id\n * }\n * ```\n */\n addKeyAltName(_id: Binary, keyAltName: string): Promise<WithId<DataKey> | null>;\n /**\n * Adds a keyAltName to a key identified by the provided _id.\n *\n * This method resolves to/returns the *old* key value (prior to removing the new altKeyName).\n *\n * If the removed keyAltName is the last keyAltName for that key, the `altKeyNames` property is unset from the document.\n *\n * @param _id - The id of the document to update.\n * @param keyAltName - a keyAltName to search for a key\n * @returns Returns a promise that either resolves to a {@link DataKey} if a document matches the key or null if no documents\n * match the id. The promise rejects with an error if an error is thrown.\n * @example\n * ```ts\n * // removing a key alt name from a data key\n * const id = new Binary(); // id is a bson binary subtype 4 object\n * const keyAltName = 'keyAltName';\n * const oldKey = await clientEncryption.removeKeyAltName(id, keyAltName);\n *\n * if (!oldKey) {\n * // null is returned if there is no matching document with an id matching the supplied id\n * }\n * ```\n */\n removeKeyAltName(_id: Binary, keyAltName: string): Promise<WithId<DataKey> | null>;\n /**\n * A convenience method for creating an encrypted collection.\n * This method will create data keys for any encryptedFields that do not have a `keyId` defined\n * and then create a new collection with the full set of encryptedFields.\n *\n * @param db - A Node.js driver Db object with which to create the collection\n * @param name - The name of the collection to be created\n * @param options - Options for createDataKey and for createCollection\n * @returns created collection and generated encryptedFields\n * @throws MongoCryptCreateDataKeyError - If part way through the process a createDataKey invocation fails, an error will be rejected that has the partial `encryptedFields` that were created.\n * @throws MongoCryptCreateEncryptedCollectionError - If creating the collection fails, an error will be rejected that has the entire `encryptedFields` that were created.\n */\n createEncryptedCollection<TSchema extends Document = Document>(db: Db, name: string, options: {\n provider: ClientEncryptionDataKeyProvider;\n createCollectionOptions: Omit<CreateCollectionOptions, 'encryptedFields'> & {\n encryptedFields: Document;\n };\n masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions;\n }): Promise<{\n collection: Collection<TSchema>;\n encryptedFields: Document;\n }>;\n /**\n * Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must\n * be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.\n *\n * @param value - The value that you wish to serialize. Must be of a type that can be serialized into BSON\n * @param options -\n * @returns a Promise that either resolves with the encrypted value, or rejects with an error.\n *\n * @example\n * ```ts\n * // Encryption with async/await api\n * async function encryptMyData(value) {\n * const keyId = await clientEncryption.createDataKey('local');\n * return clientEncryption.encrypt(value, { keyId, algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });\n * }\n * ```\n *\n * @example\n * ```ts\n * // Encryption using a keyAltName\n * async function encryptMyData(value) {\n * await clientEncryption.createDataKey('local', { keyAltNames: 'mySpecialKey' });\n * return clientEncryption.encrypt(value, { keyAltName: 'mySpecialKey', algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' });\n * }\n * ```\n */\n encrypt(value: unknown, options: ClientEncryptionEncryptOptions): Promise<Binary>;\n /**\n * Encrypts a Match Expression or Aggregate Expression to query a range index.\n *\n * Only supported when queryType is \"range\" and algorithm is \"Range\".\n *\n * @param expression - a BSON document of one of the following forms:\n * 1. A Match Expression of this form:\n * `{$and: [{<field>: {$gt: <value1>}}, {<field>: {$lt: <value2> }}]}`\n * 2. An Aggregate Expression of this form:\n * `{$and: [{$gt: [<fieldpath>, <value1>]}, {$lt: [<fieldpath>, <value2>]}]}`\n *\n * `$gt` may also be `$gte`. `$lt` may also be `$lte`.\n *\n * @param options -\n * @returns Returns a Promise that either resolves with the encrypted value or rejects with an error.\n */\n encryptExpression(expression: Document, options: ClientEncryptionEncryptOptions): Promise<Binary>;\n /**\n * Explicitly decrypt a provided encrypted value\n *\n * @param value - An encrypted value\n * @returns a Promise that either resolves with the decrypted value, or rejects with an error\n *\n * @example\n * ```ts\n * // Decrypting value with async/await API\n * async function decryptMyValue(value) {\n * return clientEncryption.decrypt(value);\n * }\n * ```\n */\n decrypt<T = any>(value: Binary): Promise<T>;\n /* Excluded from this release type: askForKMSCredentials */\n static get libmongocryptVersion(): string;\n /* Excluded from this release type: _encrypt */\n}\n\n/**\n * @public\n * Options to provide when creating a new data key.\n */\nexport declare interface ClientEncryptionCreateDataKeyProviderOptions {\n /**\n * Identifies a new KMS-specific key used to encrypt the new data key\n */\n masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | KMIPEncryptionKeyOptions | undefined;\n /**\n * An optional list of string alternate names used to reference a key.\n * If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id.\n */\n keyAltNames?: string[] | undefined;\n /** @experimental */\n keyMaterial?: Buffer | Binary;\n /* Excluded from this release type: timeoutContext */\n}\n\n/**\n * @public\n *\n * A data key provider. Allowed values:\n *\n * - aws, gcp, local, kmip or azure\n * - (`mongodb-client-encryption>=6.0.1` only) a named key, in the form of:\n * `aws:<name>`, `gcp:<name>`, `local:<name>`, `kmip:<name>`, `azure:<name>`\n * where `name` is an alphanumeric string, underscores allowed.\n */\nexport declare type ClientEncryptionDataKeyProvider = keyof KMSProviders;\n\n/**\n * @public\n * Options to provide when encrypting data.\n */\nexport declare interface ClientEncryptionEncryptOptions {\n /**\n * The algorithm to use for encryption.\n */\n algorithm: 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic' | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random' | 'Indexed' | 'Unindexed' | 'Range';\n /**\n * The id of the Binary dataKey to use for encryption\n */\n keyId?: Binary;\n /**\n * A unique string name corresponding to an already existing dataKey.\n */\n keyAltName?: string;\n /** The contention factor. */\n contentionFactor?: bigint | number;\n /**\n * The query type.\n */\n queryType?: 'equality' | 'range';\n /** The index options for a Queryable Encryption field supporting \"range\" queries.*/\n rangeOptions?: RangeOptions;\n}\n\n/**\n * @public\n * Additional settings to provide when creating a new `ClientEncryption` instance.\n */\nexport declare interface ClientEncryptionOptions {\n /**\n * The namespace of the key vault, used to store encryption keys\n */\n keyVaultNamespace: string;\n /**\n * A MongoClient used to fetch keys from a key vault. Defaults to client.\n */\n keyVaultClient?: MongoClient | undefined;\n /**\n * Options for specific KMS providers to use\n */\n kmsProviders?: KMSProviders;\n /**\n * Options for user provided custom credential providers.\n */\n credentialProviders?: CredentialProviders;\n /**\n * Options for specifying a Socks5 proxy to use for connecting to the KMS.\n */\n proxyOptions?: ProxyOptions;\n /**\n * TLS options for kms providers to use.\n */\n tlsOptions?: CSFLEKMSTlsOptions;\n /**\n * @experimental\n *\n * The timeout setting to be used for all the operations on ClientEncryption.\n *\n * When provided, `timeoutMS` is used as the timeout for each operation executed on\n * the ClientEncryption object. For example:\n *\n * ```typescript\n * const clientEncryption = new ClientEncryption(client, {\n * timeoutMS: 1_000\n * kmsProviders: { local: { key: '<KEY>' } }\n * });\n *\n * // `1_000` is used as the timeout for createDataKey call\n * await clientEncryption.createDataKey('local');\n * ```\n *\n * If `timeoutMS` is configured on the provided client, the client's `timeoutMS` value\n * will be used unless `timeoutMS` is also provided as a client encryption option.\n *\n * ```typescript\n * const client = new MongoClient('<uri>', { timeoutMS: 2_000 });\n *\n * // timeoutMS is set to 1_000 on clientEncryption\n * const clientEncryption = new ClientEncryption(client, {\n * timeoutMS: 1_000\n * kmsProviders: { local: { key: '<KEY>' } }\n * });\n * ```\n */\n timeoutMS?: number;\n}\n\n/**\n * @public\n * @experimental\n */\nexport declare interface ClientEncryptionRewrapManyDataKeyProviderOptions {\n provider: ClientEncryptionDataKeyProvider;\n masterKey?: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | KMIPEncryptionKeyOptions | undefined;\n}\n\n/**\n * @public\n * @experimental\n */\nexport declare interface ClientEncryptionRewrapManyDataKeyResult {\n /** The result of rewrapping data keys. If unset, no keys matched the filter. */\n bulkWriteResult?: BulkWriteResult;\n}\n\n/**\n * @public\n *\n * Socket options to use for KMS requests.\n */\nexport declare type ClientEncryptionSocketOptions = Pick<MongoClientOptions, 'autoSelectFamily' | 'autoSelectFamilyAttemptTimeout'>;\n\n/**\n * @public\n *\n * TLS options to use when connecting. The spec specifically calls out which insecure\n * tls options are not allowed:\n *\n * - tlsAllowInvalidCertificates\n * - tlsAllowInvalidHostnames\n * - tlsInsecure\n *\n * These options are not included in the type, and are ignored if provided.\n */\nexport declare type ClientEncryptionTlsOptions = Pick<MongoClientOptions, 'tlsCAFile' | 'tlsCertificateKeyFile' | 'tlsCertificateKeyFilePassword'>;\n\n/** @public */\nexport declare interface ClientInsertOneModel<TSchema> extends ClientWriteModel {\n name: 'insertOne';\n /** The document to insert. */\n document: OptionalId<TSchema>;\n}\n\n/** @public */\nexport declare interface ClientInsertOneResult {\n /**\n * The _id of the inserted document.\n */\n insertedId: any;\n}\n\n/**\n * @public\n * @see https://github.com/mongodb/specifications/blob/master/source/mongodb-handshake/handshake.md#hello-command\n */\nexport declare interface ClientMetadata {\n driver: {\n name: string;\n version: string;\n };\n os: {\n type: string;\n name?: NodeJS.Platform;\n architecture?: string;\n version?: string;\n };\n platform: string;\n application?: {\n name: string;\n };\n /** FaaS environment information */\n env?: {\n name: 'aws.lambda' | 'gcp.func' | 'azure.func' | 'vercel';\n timeout_sec?: Int32;\n memory_mb?: Int32;\n region?: string;\n url?: string;\n };\n}\n\n/** @public */\nexport declare interface ClientMetadataOptions {\n driverInfo?: {\n name?: string;\n version?: string;\n platform?: string;\n };\n appName?: string;\n}\n\n/** @public */\nexport declare interface ClientReplaceOneModel<TSchema> extends ClientWriteModel {\n name: 'replaceOne';\n /**\n * The filter used to determine if a document should be replaced.\n * For a replaceOne operation, the first match is replaced.\n */\n filter: Filter<TSchema>;\n /** The document with which to replace the matched document. */\n replacement: WithoutId<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/**\n * A class representing a client session on the server\n *\n * NOTE: not meant to be instantiated directly.\n * @public\n */\nexport declare class ClientSession extends TypedEventEmitter<ClientSessionEvents> implements AsyncDisposable_2 {\n /* Excluded from this release type: client */\n /* Excluded from this release type: sessionPool */\n hasEnded: boolean;\n clientOptions: MongoOptions;\n supports: {\n causalConsistency: boolean;\n };\n clusterTime?: ClusterTime;\n operationTime?: Timestamp;\n explicit: boolean;\n /* Excluded from this release type: owner */\n defaultTransactionOptions: TransactionOptions;\n transaction: Transaction;\n /* Excluded from this release type: commitAttempted */\n readonly snapshotEnabled: boolean;\n /* Excluded from this release type: _serverSession */\n /* Excluded from this release type: snapshotTime */\n /* Excluded from this release type: pinnedConnection */\n /* Excluded from this release type: txnNumberIncrement */\n /**\n * @experimental\n * Specifies the time an operation in a given `ClientSession` will run until it throws a timeout error\n */\n timeoutMS?: number;\n /* Excluded from this release type: timeoutContext */\n /* Excluded from this release type: __constructor */\n /** The server id associated with this session */\n get id(): ServerSessionId | undefined;\n get serverSession(): ServerSession;\n get loadBalanced(): boolean;\n /* Excluded from this release type: pin */\n /* Excluded from this release type: unpin */\n get isPinned(): boolean;\n /**\n * Frees any client-side resources held by the current session. If a session is in a transaction,\n * the transaction is aborted.\n *\n * Does not end the session on the server.\n *\n * @param options - Optional settings. Currently reserved for future use\n */\n endSession(options?: EndSessionOptions): Promise<void>;\n /* Excluded from this release type: [Symbol.asyncDispose] */\n /* Excluded from this release type: asyncDispose */\n /**\n * Advances the operationTime for a ClientSession.\n *\n * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to\n */\n advanceOperationTime(operationTime: Timestamp): void;\n /**\n * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession\n *\n * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature\n */\n advanceClusterTime(clusterTime: ClusterTime): void;\n /**\n * Used to determine if this session equals another\n *\n * @param session - The session to compare to\n */\n equals(session: ClientSession): boolean;\n /**\n * Increment the transaction number on the internal ServerSession\n *\n * @privateRemarks\n * This helper increments a value stored on the client session that will be\n * added to the serverSession's txnNumber upon applying it to a command.\n * This is because the serverSession is lazily acquired after a connection is obtained\n */\n incrementTransactionNumber(): void;\n /** @returns whether this session is currently in a transaction or not */\n inTransaction(): boolean;\n /**\n * Starts a new transaction with the given options.\n *\n * @remarks\n * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`,\n * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is\n * undefined behaviour.\n *\n * @param options - Options for the transaction\n */\n startTransaction(options?: TransactionOptions): void;\n /**\n * Commits the currently active transaction in this session.\n *\n * @param options - Optional options, can be used to override `defaultTimeoutMS`.\n */\n commitTransaction(options?: {\n timeoutMS?: number;\n }): Promise<void>;\n /**\n * Aborts the currently active transaction in this session.\n *\n * @param options - Optional options, can be used to override `defaultTimeoutMS`.\n */\n abortTransaction(options?: {\n timeoutMS?: number;\n }): Promise<void>;\n /* Excluded from this release type: abortTransaction */\n /**\n * This is here to ensure that ClientSession is never serialized to BSON.\n */\n toBSON(): never;\n /**\n * Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed.\n *\n * **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise.\n *\n * **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,\n * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is\n * undefined behaviour.\n *\n * **IMPORTANT:** When running an operation inside a `withTransaction` callback, if it is not\n * provided the explicit session in its options, it will not be part of the transaction and it will not respect timeoutMS.\n *\n *\n * @remarks\n * - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function.\n * - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error.\n * - If the transaction is manually aborted within the provided function it will not throw.\n * - If the driver needs to attempt to retry the operations, the provided function may be called multiple times.\n *\n * Checkout a descriptive example here:\n * @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions\n *\n * If a command inside withTransaction fails:\n * - It may cause the transaction on the server to be aborted.\n * - This situation is normally handled transparently by the driver.\n * - However, if the application catches such an error and does not rethrow it, the driver will not be able to determine whether the transaction was aborted or not.\n * - The driver will then retry the transaction indefinitely.\n *\n * To avoid this situation, the application must not silently handle errors within the provided function.\n * If the application needs to handle errors within, it must await all operations such that if an operation is rejected it becomes the rejection of the callback function passed into withTransaction.\n *\n * @param fn - callback to run within a transaction\n * @param options - optional settings for the transaction\n * @returns A raw command response or undefined\n */\n withTransaction<T = any>(fn: WithTransactionCallback<T>, options?: TransactionOptions & {\n /**\n * Configures a timeoutMS expiry for the entire withTransactionCallback.\n *\n * @remarks\n * - The remaining timeout will not be applied to callback operations that do not use the ClientSession.\n * - Overriding timeoutMS for operations executed using the explicit session inside the provided callback will result in a client-side error.\n */\n timeoutMS?: number;\n }): Promise<T>;\n}\n\n/** @public */\nexport declare type ClientSessionEvents = {\n ended(session: ClientSession): void;\n};\n\n/** @public */\nexport declare interface ClientSessionOptions {\n /** Whether causal consistency should be enabled on this session */\n causalConsistency?: boolean;\n /** Whether all read operations should be read from the same snapshot for this session (NOTE: not compatible with `causalConsistency=true`) */\n snapshot?: boolean;\n /** The default TransactionOptions to use for transactions started on this session. */\n defaultTransactionOptions?: TransactionOptions;\n /**\n * @public\n * @experimental\n * An overriding timeoutMS value to use for a client-side timeout.\n * If not provided the session uses the timeoutMS specified on the MongoClient.\n */\n defaultTimeoutMS?: number;\n /* Excluded from this release type: owner */\n /* Excluded from this release type: explicit */\n /* Excluded from this release type: initialClusterTime */\n}\n\n/** @public */\nexport declare interface ClientUpdateManyModel<TSchema> extends ClientWriteModel {\n name: 'updateMany';\n /**\n * The filter used to determine if a document should be updated.\n * For an updateMany operation, all matches are updated.\n */\n filter: Filter<TSchema>;\n /**\n * The modifications to apply. The value can be either:\n * UpdateFilter<Document> - A document that contains update operator expressions,\n * Document[] - an aggregation pipeline.\n */\n update: UpdateFilter<TSchema> | Document[];\n /** A set of filters specifying to which array elements an update should apply. */\n arrayFilters?: Document[];\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/** @public */\nexport declare interface ClientUpdateOneModel<TSchema> extends ClientWriteModel {\n name: 'updateOne';\n /**\n * The filter used to determine if a document should be updated.\n * For an updateOne operation, the first match is updated.\n */\n filter: Filter<TSchema>;\n /**\n * The modifications to apply. The value can be either:\n * UpdateFilter<Document> - A document that contains update operator expressions,\n * Document[] - an aggregation pipeline.\n */\n update: UpdateFilter<TSchema> | Document[];\n /** A set of filters specifying to which array elements an update should apply. */\n arrayFilters?: Document[];\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/** @public */\nexport declare interface ClientUpdateResult {\n /**\n * The number of documents that matched the filter.\n */\n matchedCount: number;\n /**\n * The number of documents that were modified.\n */\n modifiedCount: number;\n /**\n * The _id field of the upserted document if an upsert occurred.\n *\n * It MUST be possible to discern between a BSON Null upserted ID value and this field being\n * unset. If necessary, drivers MAY add a didUpsert boolean field to differentiate between\n * these two cases.\n */\n upsertedId?: any;\n /**\n * Determines if the upsert did include an _id, which includes the case of the _id being null.\n */\n didUpsert: boolean;\n}\n\n/** @public */\nexport declare interface ClientWriteModel {\n /**\n * The namespace for the write.\n *\n * A namespace is a combination of the database name and the name of the collection: `<database-name>.<collection>`.\n * All documents belong to a namespace.\n *\n * @see https://www.mongodb.com/docs/manual/reference/limits/#std-label-faq-dev-namespace\n */\n namespace: string;\n}\n\n/**\n * @public\n * @deprecated This interface is deprecated and will be removed in a future release as it is not used\n * in the driver\n */\nexport declare interface CloseOptions {\n force?: boolean;\n}\n\n/** @public\n * Configuration options for clustered collections\n * @see https://www.mongodb.com/docs/manual/core/clustered-collections/\n */\nexport declare interface ClusteredCollectionOptions extends Document {\n name?: string;\n key: Document;\n unique: boolean;\n}\n\n/**\n * @public\n * Gossiped in component for the cluster time tracking the state of user databases\n * across the cluster. It may optionally include a signature identifying the process that\n * generated such a value.\n */\nexport declare interface ClusterTime {\n clusterTime: Timestamp;\n /** Used to validate the identity of a request or response's ClusterTime. */\n signature?: {\n hash: Binary;\n keyId: Long;\n };\n}\n\nexport { Code }\n\n/** @public */\nexport declare interface CollationOptions {\n locale: string;\n caseLevel?: boolean;\n caseFirst?: string;\n strength?: number;\n numericOrdering?: boolean;\n alternate?: string;\n maxVariable?: string;\n backwards?: boolean;\n normalization?: boolean;\n}\n\n/**\n * The **Collection** class is an internal class that embodies a MongoDB collection\n * allowing for insert/find/update/delete and other command operation on that MongoDB collection.\n *\n * **COLLECTION Cannot directly be instantiated**\n * @public\n *\n * @example\n * ```ts\n * import { MongoClient } from '/mongodb.ts';\n *\n * interface Pet {\n * name: string;\n * kind: 'dog' | 'cat' | 'fish';\n * }\n *\n * const client = new MongoClient('mongodb://localhost:27017');\n * const pets = client.db().collection<Pet>('pets');\n *\n * const petCursor = pets.find();\n *\n * for await (const pet of petCursor) {\n * console.log(`${pet.name} is a ${pet.kind}!`);\n * }\n * ```\n */\nexport declare class Collection<TSchema extends Document = Document> {\n /* Excluded from this release type: s */\n /* Excluded from this release type: client */\n /* Excluded from this release type: __constructor */\n /**\n * The name of the database this collection belongs to\n */\n get dbName(): string;\n /**\n * The name of this collection\n */\n get collectionName(): string;\n /**\n * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}`\n */\n get namespace(): string;\n /* Excluded from this release type: fullNamespace */\n /**\n * The current readConcern of the collection. If not explicitly defined for\n * this collection, will be inherited from the parent DB\n */\n get readConcern(): ReadConcern | undefined;\n /**\n * The current readPreference of the collection. If not explicitly defined for\n * this collection, will be inherited from the parent DB\n */\n get readPreference(): ReadPreference | undefined;\n get bsonOptions(): BSONSerializeOptions;\n /**\n * The current writeConcern of the collection. If not explicitly defined for\n * this collection, will be inherited from the parent DB\n */\n get writeConcern(): WriteConcern | undefined;\n /** The current index hint for the collection */\n get hint(): Hint | undefined;\n set hint(v: Hint | undefined);\n get timeoutMS(): number | undefined;\n /**\n * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field,\n * one will be added to each of the documents missing it by the driver, mutating the document. This behavior\n * can be overridden by setting the **forceServerObjectId** flag.\n *\n * @param doc - The document to insert\n * @param options - Optional settings for the command\n */\n insertOne(doc: OptionalUnlessRequiredId<TSchema>, options?: InsertOneOptions): Promise<InsertOneResult<TSchema>>;\n /**\n * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field,\n * one will be added to each of the documents missing it by the driver, mutating the document. This behavior\n * can be overridden by setting the **forceServerObjectId** flag.\n *\n * @param docs - The documents to insert\n * @param options - Optional settings for the command\n */\n insertMany(docs: ReadonlyArray<OptionalUnlessRequiredId<TSchema>>, options?: BulkWriteOptions): Promise<InsertManyResult<TSchema>>;\n /**\n * Perform a bulkWrite operation without a fluent API\n *\n * Legal operation types are\n * - `insertOne`\n * - `replaceOne`\n * - `updateOne`\n * - `updateMany`\n * - `deleteOne`\n * - `deleteMany`\n *\n * If documents passed in do not contain the **_id** field,\n * one will be added to each of the documents missing it by the driver, mutating the document. This behavior\n * can be overridden by setting the **forceServerObjectId** flag.\n *\n * @param operations - Bulk operations to perform\n * @param options - Optional settings for the command\n * @throws MongoDriverError if operations is not an array\n */\n bulkWrite(operations: ReadonlyArray<AnyBulkWriteOperation<TSchema>>, options?: BulkWriteOptions): Promise<BulkWriteResult>;\n /**\n * Update a single document in a collection\n *\n * The value of `update` can be either:\n * - UpdateFilter<TSchema> - A document that contains update operator expressions,\n * - Document[] - an aggregation pipeline.\n *\n * @param filter - The filter used to select the document to update\n * @param update - The modifications to apply\n * @param options - Optional settings for the command\n */\n updateOne(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[], options?: UpdateOptions): Promise<UpdateResult<TSchema>>;\n /**\n * Replace a document in a collection with another document\n *\n * @param filter - The filter used to select the document to replace\n * @param replacement - The Document that replaces the matching document\n * @param options - Optional settings for the command\n */\n replaceOne(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options?: ReplaceOptions): Promise<UpdateResult<TSchema>>;\n /**\n * Update multiple documents in a collection\n *\n * The value of `update` can be either:\n * - UpdateFilter<TSchema> - A document that contains update operator expressions,\n * - Document[] - an aggregation pipeline.\n *\n * @param filter - The filter used to select the document to update\n * @param update - The modifications to apply\n * @param options - Optional settings for the command\n */\n updateMany(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[], options?: UpdateOptions): Promise<UpdateResult<TSchema>>;\n /**\n * Delete a document from a collection\n *\n * @param filter - The filter used to select the document to remove\n * @param options - Optional settings for the command\n */\n deleteOne(filter?: Filter<TSchema>, options?: DeleteOptions): Promise<DeleteResult>;\n /**\n * Delete multiple documents from a collection\n *\n * @param filter - The filter used to select the documents to remove\n * @param options - Optional settings for the command\n */\n deleteMany(filter?: Filter<TSchema>, options?: DeleteOptions): Promise<DeleteResult>;\n /**\n * Rename the collection.\n *\n * @remarks\n * This operation does not inherit options from the Db or MongoClient.\n *\n * @param newName - New name of of the collection.\n * @param options - Optional settings for the command\n */\n rename(newName: string, options?: RenameOptions): Promise<Collection>;\n /**\n * Drop the collection from the database, removing it permanently. New accesses will create a new collection.\n *\n * @param options - Optional settings for the command\n */\n drop(options?: DropCollectionOptions): Promise<boolean>;\n /**\n * Fetches the first document that matches the filter\n *\n * @param filter - Query for find Operation\n * @param options - Optional settings for the command\n */\n findOne(): Promise<WithId<TSchema> | null>;\n findOne(filter: Filter<TSchema>): Promise<WithId<TSchema> | null>;\n findOne(filter: Filter<TSchema>, options: Omit<FindOptions, 'timeoutMode'> & Abortable): Promise<WithId<TSchema> | null>;\n findOne<T = TSchema>(): Promise<T | null>;\n findOne<T = TSchema>(filter: Filter<TSchema>): Promise<T | null>;\n findOne<T = TSchema>(filter: Filter<TSchema>, options?: Omit<FindOptions, 'timeoutMode'> & Abortable): Promise<T | null>;\n /**\n * Creates a cursor for a filter that can be used to iterate over results from MongoDB\n *\n * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate\n */\n find(): FindCursor<WithId<TSchema>>;\n find(filter: Filter<TSchema>, options?: FindOptions & Abortable): FindCursor<WithId<TSchema>>;\n find<T extends Document>(filter: Filter<TSchema>, options?: FindOptions & Abortable): FindCursor<T>;\n /**\n * Returns the options of the collection.\n *\n * @param options - Optional settings for the command\n */\n options(options?: OperationOptions): Promise<Document>;\n /**\n * Returns if the collection is a capped collection\n *\n * @param options - Optional settings for the command\n */\n isCapped(options?: OperationOptions): Promise<boolean>;\n /**\n * Creates an index on the db and collection collection.\n *\n * @param indexSpec - The field name or index specification to create an index for\n * @param options - Optional settings for the command\n *\n * @example\n * ```ts\n * const collection = client.db('foo').collection('bar');\n *\n * await collection.createIndex({ a: 1, b: -1 });\n *\n * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes\n * await collection.createIndex([ [c, 1], [d, -1] ]);\n *\n * // Equivalent to { e: 1 }\n * await collection.createIndex('e');\n *\n * // Equivalent to { f: 1, g: 1 }\n * await collection.createIndex(['f', 'g'])\n *\n * // Equivalent to { h: 1, i: -1 }\n * await collection.createIndex([ { h: 1 }, { i: -1 } ]);\n *\n * // Equivalent to { j: 1, k: -1, l: 2d }\n * await collection.createIndex(['j', ['k', -1], { l: '2d' }])\n * ```\n */\n createIndex(indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise<string>;\n /**\n * Creates multiple indexes in the collection, this method is only supported for\n * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported\n * error.\n *\n * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications.\n * Index specifications are defined {@link https://www.mongodb.com/docs/manual/reference/command/createIndexes/| here}.\n *\n * @param indexSpecs - An array of index specifications to be created\n * @param options - Optional settings for the command\n *\n * @example\n * ```ts\n * const collection = client.db('foo').collection('bar');\n * await collection.createIndexes([\n * // Simple index on field fizz\n * {\n * key: { fizz: 1 },\n * }\n * // wildcard index\n * {\n * key: { '$**': 1 }\n * },\n * // named index on darmok and jalad\n * {\n * key: { darmok: 1, jalad: -1 }\n * name: 'tanagra'\n * }\n * ]);\n * ```\n */\n createIndexes(indexSpecs: IndexDescription[], options?: CreateIndexesOptions): Promise<string[]>;\n /**\n * Drops an index from this collection.\n *\n * @param indexName - Name of the index to drop.\n * @param options - Optional settings for the command\n */\n dropIndex(indexName: string, options?: DropIndexesOptions): Promise<Document>;\n /**\n * Drops all indexes from this collection.\n *\n * @param options - Optional settings for the command\n */\n dropIndexes(options?: DropIndexesOptions): Promise<boolean>;\n /**\n * Get the list of all indexes information for the collection.\n *\n * @param options - Optional settings for the command\n */\n listIndexes(options?: ListIndexesOptions): ListIndexesCursor;\n /**\n * Checks if one or more indexes exist on the collection, fails on first non-existing index\n *\n * @param indexes - One or more index names to check.\n * @param options - Optional settings for the command\n */\n indexExists(indexes: string | string[], options?: ListIndexesOptions): Promise<boolean>;\n /**\n * Retrieves this collections index info.\n *\n * @param options - Optional settings for the command\n */\n indexInformation(options: IndexInformationOptions & {\n full: true;\n }): Promise<IndexDescriptionInfo[]>;\n indexInformation(options: IndexInformationOptions & {\n full?: false;\n }): Promise<IndexDescriptionCompact>;\n indexInformation(options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;\n indexInformation(): Promise<IndexDescriptionCompact>;\n /**\n * Gets an estimate of the count of documents in a collection using collection metadata.\n * This will always run a count command on all server versions.\n *\n * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command,\n * which estimatedDocumentCount uses in its implementation, was not included in v1 of\n * the Stable API, and so users of the Stable API with estimatedDocumentCount are\n * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid\n * encountering errors.\n *\n * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior}\n * @param options - Optional settings for the command\n */\n estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number>;\n /**\n * Gets the number of documents matching the filter.\n * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}.\n *\n * Due to countDocuments using the $match aggregation pipeline stage, certain query operators cannot be used in countDocuments. This includes the $where and $near query operators, among others. Details can be found in the documentation for the $match aggregation pipeline stage.\n *\n * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments}\n * the following query operators must be replaced:\n *\n * | Operator | Replacement |\n * | -------- | ----------- |\n * | `$where` | [`$expr`][1] |\n * | `$near` | [`$geoWithin`][2] with [`$center`][3] |\n * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] |\n *\n * [1]: https://www.mongodb.com/docs/manual/reference/operator/query/expr/\n * [2]: https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/\n * [3]: https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center\n * [4]: https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere\n *\n * @param filter - The filter for the count\n * @param options - Optional settings for the command\n *\n * @see https://www.mongodb.com/docs/manual/reference/operator/query/expr/\n * @see https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/\n * @see https://www.mongodb.com/docs/manual/reference/operator/query/center/#op._S_center\n * @see https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/#op._S_centerSphere\n */\n countDocuments(filter?: Filter<TSchema>, options?: CountDocumentsOptions & Abortable): Promise<number>;\n /**\n * The distinct command returns a list of distinct values for the given key across a collection.\n *\n * @param key - Field of the document to find distinct values for\n * @param filter - The filter for filtering the set of documents to which we apply the distinct filter.\n * @param options - Optional settings for the command\n */\n distinct<Key extends keyof WithId<TSchema>>(key: Key): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;\n distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;\n distinct<Key extends keyof WithId<TSchema>>(key: Key, filter: Filter<TSchema>, options: DistinctOptions): Promise<Array<Flatten<WithId<TSchema>[Key]>>>;\n distinct(key: string): Promise<any[]>;\n distinct(key: string, filter: Filter<TSchema>): Promise<any[]>;\n distinct(key: string, filter: Filter<TSchema>, options: DistinctOptions): Promise<any[]>;\n /**\n * Retrieve all the indexes on the collection.\n *\n * @param options - Optional settings for the command\n */\n indexes(options: IndexInformationOptions & {\n full?: true;\n }): Promise<IndexDescriptionInfo[]>;\n indexes(options: IndexInformationOptions & {\n full: false;\n }): Promise<IndexDescriptionCompact>;\n indexes(options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;\n indexes(options?: ListIndexesOptions): Promise<IndexDescriptionInfo[]>;\n /**\n * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation.\n *\n * @param filter - The filter used to select the document to remove\n * @param options - Optional settings for the command\n */\n findOneAndDelete(filter: Filter<TSchema>, options: FindOneAndDeleteOptions & {\n includeResultMetadata: true;\n }): Promise<ModifyResult<TSchema>>;\n findOneAndDelete(filter: Filter<TSchema>, options: FindOneAndDeleteOptions & {\n includeResultMetadata: false;\n }): Promise<WithId<TSchema> | null>;\n findOneAndDelete(filter: Filter<TSchema>, options: FindOneAndDeleteOptions): Promise<WithId<TSchema> | null>;\n findOneAndDelete(filter: Filter<TSchema>): Promise<WithId<TSchema> | null>;\n /**\n * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation.\n *\n * @param filter - The filter used to select the document to replace\n * @param replacement - The Document that replaces the matching document\n * @param options - Optional settings for the command\n */\n findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions & {\n includeResultMetadata: true;\n }): Promise<ModifyResult<TSchema>>;\n findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions & {\n includeResultMetadata: false;\n }): Promise<WithId<TSchema> | null>;\n findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>, options: FindOneAndReplaceOptions): Promise<WithId<TSchema> | null>;\n findOneAndReplace(filter: Filter<TSchema>, replacement: WithoutId<TSchema>): Promise<WithId<TSchema> | null>;\n /**\n * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.\n *\n * The value of `update` can be either:\n * - UpdateFilter<TSchema> - A document that contains update operator expressions,\n * - Document[] - an aggregation pipeline consisting of the following stages:\n * - $addFields and its alias $set\n * - $project and its alias $unset\n * - $replaceRoot and its alias $replaceWith.\n * See the [findAndModify command documentation](https://www.mongodb.com/docs/manual/reference/command/findAndModify) for details.\n *\n * @param filter - The filter used to select the document to update\n * @param update - The modifications to apply\n * @param options - Optional settings for the command\n */\n findOneAndUpdate(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[], options: FindOneAndUpdateOptions & {\n includeResultMetadata: true;\n }): Promise<ModifyResult<TSchema>>;\n findOneAndUpdate(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[], options: FindOneAndUpdateOptions & {\n includeResultMetadata: false;\n }): Promise<WithId<TSchema> | null>;\n findOneAndUpdate(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[], options: FindOneAndUpdateOptions): Promise<WithId<TSchema> | null>;\n findOneAndUpdate(filter: Filter<TSchema>, update: UpdateFilter<TSchema> | Document[]): Promise<WithId<TSchema> | null>;\n /**\n * Execute an aggregation framework pipeline against the collection, needs MongoDB \\>= 2.2\n *\n * @param pipeline - An array of aggregation pipelines to execute\n * @param options - Optional settings for the command\n */\n aggregate<T extends Document = Document>(pipeline?: Document[], options?: AggregateOptions & Abortable): AggregationCursor<T>;\n /**\n * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection.\n *\n * @remarks\n * watch() accepts two generic arguments for distinct use cases:\n * - The first is to override the schema that may be defined for this specific collection\n * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument\n * @example\n * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>`\n * ```ts\n * collection.watch<{ _id: number }>()\n * .on('change', change => console.log(change._id.toFixed(4)));\n * ```\n *\n * @example\n * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline.\n * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment.\n * No need start from scratch on the ChangeStreamInsertDocument type!\n * By using an intersection we can save time and ensure defaults remain the same type!\n * ```ts\n * collection\n * .watch<Schema, ChangeStreamInsertDocument<Schema> & { comment: string }>([\n * { $addFields: { comment: 'big changes' } },\n * { $match: { operationType: 'insert' } }\n * ])\n * .on('change', change => {\n * change.comment.startsWith('big');\n * change.operationType === 'insert';\n * // No need to narrow in code because the generics did that for us!\n * expectType<Schema>(change.fullDocument);\n * });\n * ```\n *\n * @remarks\n * When `timeoutMS` is configured for a change stream, it will have different behaviour depending\n * on whether the change stream is in iterator mode or emitter mode. In both cases, a change\n * stream will time out if it does not receive a change event within `timeoutMS` of the last change\n * event.\n *\n * Note that if a change stream is consistently timing out when watching a collection, database or\n * client that is being changed, then this may be due to the server timing out before it can finish\n * processing the existing oplog. To address this, restart the change stream with a higher\n * `timeoutMS`.\n *\n * If the change stream times out the initial aggregate operation to establish the change stream on\n * the server, then the client will close the change stream. If the getMore calls to the server\n * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError\n * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in\n * emitter mode.\n *\n * To determine whether or not the change stream is still open following a timeout, check the\n * {@link ChangeStream.closed} getter.\n *\n * @example\n * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream.\n * The next call can just be retried after this succeeds.\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * try {\n * await changeStream.next();\n * } catch (e) {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * await changeStream.next();\n * }\n * throw e;\n * }\n * ```\n *\n * @example\n * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will\n * emit an error event that returns a MongoOperationTimeoutError, but will not close the change\n * stream unless the resume attempt fails. There is no need to re-establish change listeners as\n * this will automatically continue emitting change events once the resume attempt completes.\n *\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * changeStream.on('change', console.log);\n * changeStream.on('error', e => {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * // do nothing\n * } else {\n * changeStream.close();\n * }\n * });\n * ```\n *\n * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.\n * @param options - Optional settings for the command\n * @typeParam TLocal - Type of the data being detected by the change stream\n * @typeParam TChange - Type of the whole change stream document emitted\n */\n watch<TLocal extends Document = TSchema, TChange extends Document = ChangeStreamDocument<TLocal>>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream<TLocal, TChange>;\n /**\n * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.\n *\n * @throws MongoNotConnectedError\n * @remarks\n * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation.\n * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting.\n */\n initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation;\n /**\n * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types.\n *\n * @throws MongoNotConnectedError\n * @remarks\n * **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implementation.\n * However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting.\n */\n initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation;\n /**\n * An estimated count of matching documents in the db to a filter.\n *\n * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents\n * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}.\n * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}.\n *\n * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead\n *\n * @param filter - The filter for the count.\n * @param options - Optional settings for the command\n */\n count(filter?: Filter<TSchema>, options?: CountOptions): Promise<number>;\n /**\n * Returns all search indexes for the current collection.\n *\n * @param options - The options for the list indexes operation.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n */\n listSearchIndexes(options?: ListSearchIndexesOptions): ListSearchIndexesCursor;\n /**\n * Returns all search indexes for the current collection.\n *\n * @param name - The name of the index to search for. Only indexes with matching index names will be returned.\n * @param options - The options for the list indexes operation.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n */\n listSearchIndexes(name: string, options?: ListSearchIndexesOptions): ListSearchIndexesCursor;\n /**\n * Creates a single search index for the collection.\n *\n * @param description - The index description for the new search index.\n * @returns A promise that resolves to the name of the new search index.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n */\n createSearchIndex(description: SearchIndexDescription): Promise<string>;\n /**\n * Creates multiple search indexes for the current collection.\n *\n * @param descriptions - An array of `SearchIndexDescription`s for the new search indexes.\n * @returns A promise that resolves to an array of the newly created search index names.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n * @returns\n */\n createSearchIndexes(descriptions: SearchIndexDescription[]): Promise<string[]>;\n /**\n * Deletes a search index by index name.\n *\n * @param name - The name of the search index to be deleted.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n */\n dropSearchIndex(name: string): Promise<void>;\n /**\n * Updates a search index by replacing the existing index definition with the provided definition.\n *\n * @param name - The name of the search index to update.\n * @param definition - The new search index definition.\n *\n * @remarks Only available when used against a 7.0+ Atlas cluster.\n */\n updateSearchIndex(name: string, definition: Document): Promise<void>;\n}\n\n/** @public */\nexport declare interface CollectionInfo extends Document {\n name: string;\n type?: string;\n options?: Document;\n info?: {\n readOnly?: false;\n uuid?: Binary;\n };\n idIndex?: Document;\n}\n\n/** @public */\nexport declare interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions {\n /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */\n readConcern?: ReadConcernLike;\n /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */\n readPreference?: ReadPreferenceLike;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n}\n\n/* Excluded from this release type: CollectionPrivate */\n\n/* Excluded from this release type: COMMAND_FAILED */\n\n/* Excluded from this release type: COMMAND_STARTED */\n\n/* Excluded from this release type: COMMAND_SUCCEEDED */\n\n/**\n * An event indicating the failure of a given command\n * @public\n * @category Event\n */\nexport declare class CommandFailedEvent {\n address: string;\n /** Driver generated connection id */\n connectionId?: string | number;\n /**\n * Server generated connection id\n * Distinct from the connection id and is returned by the hello or legacy hello response as \"connectionId\" from the server on 4.2+.\n */\n serverConnectionId: bigint | null;\n requestId: number;\n duration: number;\n commandName: string;\n failure: Error;\n serviceId?: ObjectId;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n get hasServiceId(): boolean;\n}\n\n/* Excluded from this release type: CommandOperation */\n\n/** @public */\nexport declare interface CommandOperationOptions extends OperationOptions, WriteConcernOptions, ExplainOptions {\n /** Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported) */\n readConcern?: ReadConcernLike;\n /** Collation */\n collation?: CollationOptions;\n /**\n * maxTimeMS is a server-side time limit in milliseconds for processing an operation.\n */\n maxTimeMS?: number;\n /**\n * Comment to apply to the operation.\n *\n * In server versions pre-4.4, 'comment' must be string. A server\n * error will be thrown if any other type is provided.\n *\n * In server versions 4.4 and above, 'comment' can be any valid BSON type.\n */\n comment?: unknown;\n /** Should retry failed writes */\n retryWrites?: boolean;\n dbName?: string;\n authdb?: string;\n noResponse?: boolean;\n}\n\n/* Excluded from this release type: CommandOptions */\n\n/**\n * An event indicating the start of a given command\n * @public\n * @category Event\n */\nexport declare class CommandStartedEvent {\n commandObj?: Document;\n requestId: number;\n databaseName: string;\n commandName: string;\n command: Document;\n address: string;\n /** Driver generated connection id */\n connectionId?: string | number;\n /**\n * Server generated connection id\n * Distinct from the connection id and is returned by the hello or legacy hello response as \"connectionId\"\n * from the server on 4.2+.\n */\n serverConnectionId: bigint | null;\n serviceId?: ObjectId;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n get hasServiceId(): boolean;\n}\n\n/**\n * An event indicating the success of a given command\n * @public\n * @category Event\n */\nexport declare class CommandSucceededEvent {\n address: string;\n /** Driver generated connection id */\n connectionId?: string | number;\n /**\n * Server generated connection id\n * Distinct from the connection id and is returned by the hello or legacy hello response as \"connectionId\" from the server on 4.2+.\n */\n serverConnectionId: bigint | null;\n requestId: number;\n duration: number;\n commandName: string;\n reply: unknown;\n serviceId?: ObjectId;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n get hasServiceId(): boolean;\n}\n\n/** @public */\nexport declare type CommonEvents = 'newListener' | 'removeListener';\n\n/** @public */\nexport declare const Compressor: Readonly<{\n readonly none: 0;\n readonly snappy: 1;\n readonly zlib: 2;\n readonly zstd: 3;\n}>;\n\n/** @public */\nexport declare type Compressor = (typeof Compressor)[CompressorName];\n\n/** @public */\nexport declare type CompressorName = keyof typeof Compressor;\n\n/** @public */\nexport declare type Condition<T> = AlternativeType<T> | FilterOperators<AlternativeType<T>>;\n\n/* Excluded from this release type: configureExplicitResourceManagement */\n\n/* Excluded from this release type: Connection */\n\n/* Excluded from this release type: CONNECTION_CHECK_OUT_FAILED */\n\n/* Excluded from this release type: CONNECTION_CHECK_OUT_STARTED */\n\n/* Excluded from this release type: CONNECTION_CHECKED_IN */\n\n/* Excluded from this release type: CONNECTION_CHECKED_OUT */\n\n/* Excluded from this release type: CONNECTION_CLOSED */\n\n/* Excluded from this release type: CONNECTION_CREATED */\n\n/* Excluded from this release type: CONNECTION_POOL_CLEARED */\n\n/* Excluded from this release type: CONNECTION_POOL_CLOSED */\n\n/* Excluded from this release type: CONNECTION_POOL_CREATED */\n\n/* Excluded from this release type: CONNECTION_POOL_READY */\n\n/* Excluded from this release type: CONNECTION_READY */\n\n/**\n * An event published when a connection is checked into the connection pool\n * @public\n * @category Event\n */\nexport declare class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent {\n /** The id of the connection */\n connectionId: number | '<monitor>';\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection is checked out of the connection pool\n * @public\n * @category Event\n */\nexport declare class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent {\n /** The id of the connection */\n connectionId: number | '<monitor>';\n /* Excluded from this release type: name */\n /**\n * The time it took to check out the connection.\n * More specifically, the time elapsed between\n * emitting a `ConnectionCheckOutStartedEvent`\n * and emitting this event as part of the same checking out.\n *\n */\n durationMS: number;\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a request to check a connection out fails\n * @public\n * @category Event\n */\nexport declare class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent {\n /** The reason the attempt to check out failed */\n reason: string;\n /* Excluded from this release type: error */\n /* Excluded from this release type: name */\n /**\n * The time it took to check out the connection.\n * More specifically, the time elapsed between\n * emitting a `ConnectionCheckOutStartedEvent`\n * and emitting this event as part of the same check out.\n */\n durationMS: number;\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a request to check a connection out begins\n * @public\n * @category Event\n */\nexport declare class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent {\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection is closed\n * @public\n * @category Event\n */\nexport declare class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent {\n /** The id of the connection */\n connectionId: number | '<monitor>';\n /** The reason the connection was closed */\n reason: string;\n serviceId?: ObjectId;\n /* Excluded from this release type: name */\n /* Excluded from this release type: error */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection pool creates a new connection\n * @public\n * @category Event\n */\nexport declare class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent {\n /** A monotonically increasing, per-pool id for the newly created connection */\n connectionId: number | '<monitor>';\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare type ConnectionEvents = {\n commandStarted(event: CommandStartedEvent): void;\n commandSucceeded(event: CommandSucceededEvent): void;\n commandFailed(event: CommandFailedEvent): void;\n clusterTimeReceived(clusterTime: Document): void;\n close(): void;\n pinned(pinType: string): void;\n unpinned(pinType: string): void;\n};\n\n/** @public */\nexport declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions {\n id: number | '<monitor>';\n generation: number;\n hostAddress: HostAddress;\n /* Excluded from this release type: autoEncrypter */\n serverApi?: ServerApi;\n monitorCommands: boolean;\n /* Excluded from this release type: connectionType */\n credentials?: MongoCredentials;\n /* Excluded from this release type: authProviders */\n connectTimeoutMS?: number;\n tls: boolean;\n noDelay?: boolean;\n socketTimeoutMS?: number;\n cancellationToken?: CancellationToken;\n metadata: ClientMetadata;\n /* Excluded from this release type: extendedMetadata */\n /* Excluded from this release type: mongoLogger */\n}\n\n/* Excluded from this release type: ConnectionPool */\n\n/**\n * An event published when a connection pool is cleared\n * @public\n * @category Event\n */\nexport declare class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent {\n /* Excluded from this release type: serviceId */\n interruptInUseConnections?: boolean;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection pool is closed\n * @public\n * @category Event\n */\nexport declare class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent {\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection pool is created\n * @public\n * @category Event\n */\nexport declare class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent {\n /** The options used to create this connection pool */\n options: Pick<ConnectionPoolOptions, 'maxPoolSize' | 'minPoolSize' | 'maxConnecting' | 'maxIdleTimeMS' | 'waitQueueTimeoutMS'>;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare type ConnectionPoolEvents = {\n connectionPoolCreated(event: ConnectionPoolCreatedEvent): void;\n connectionPoolReady(event: ConnectionPoolReadyEvent): void;\n connectionPoolClosed(event: ConnectionPoolClosedEvent): void;\n connectionPoolCleared(event: ConnectionPoolClearedEvent): void;\n connectionCreated(event: ConnectionCreatedEvent): void;\n connectionReady(event: ConnectionReadyEvent): void;\n connectionClosed(event: ConnectionClosedEvent): void;\n connectionCheckOutStarted(event: ConnectionCheckOutStartedEvent): void;\n connectionCheckOutFailed(event: ConnectionCheckOutFailedEvent): void;\n connectionCheckedOut(event: ConnectionCheckedOutEvent): void;\n connectionCheckedIn(event: ConnectionCheckedInEvent): void;\n} & Omit<ConnectionEvents, 'close' | 'message'>;\n\n/* Excluded from this release type: ConnectionPoolMetrics */\n\n/**\n * The base export class for all monitoring events published from the connection pool\n * @public\n * @category Event\n */\nexport declare abstract class ConnectionPoolMonitoringEvent {\n /** A timestamp when the event was created */\n time: Date;\n /** The address (host/port pair) of the pool */\n address: string;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare interface ConnectionPoolOptions extends Omit<ConnectionOptions, 'id' | 'generation'> {\n /** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. */\n maxPoolSize: number;\n /** The minimum number of connections that MUST exist at any moment in a single connection pool. */\n minPoolSize: number;\n /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */\n maxConnecting: number;\n /** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. */\n maxIdleTimeMS: number;\n /** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. */\n waitQueueTimeoutMS: number;\n /** If we are in load balancer mode. */\n loadBalanced: boolean;\n /* Excluded from this release type: minPoolSizeCheckFrequencyMS */\n}\n\n/**\n * An event published when a connection pool is ready\n * @public\n * @category Event\n */\nexport declare class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEvent {\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * An event published when a connection is ready for use\n * @public\n * @category Event\n */\nexport declare class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {\n /** The id of the connection */\n connectionId: number | '<monitor>';\n /**\n * The time it took to establish the connection.\n * In accordance with the definition of establishment of a connection\n * specified by `ConnectionPoolOptions.maxConnecting`,\n * it is the time elapsed between emitting a `ConnectionCreatedEvent`\n * and emitting this event as part of the same checking out.\n *\n * Naturally, when establishing a connection is part of checking out,\n * this duration is not greater than\n * `ConnectionCheckedOutEvent.duration`.\n */\n durationMS: number;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare interface ConnectOptions {\n readPreference?: ReadPreference;\n}\n\n/** @public */\nexport declare interface CountDocumentsOptions extends AggregateOptions {\n /** The number of documents to skip. */\n skip?: number;\n /** The maximum amount of documents to consider. */\n limit?: number;\n}\n\n/** @public */\nexport declare interface CountOptions extends CommandOperationOptions {\n /** The number of documents to skip. */\n skip?: number;\n /** The maximum amounts to count before aborting. */\n limit?: number;\n /**\n * Number of milliseconds to wait before aborting the query.\n */\n maxTimeMS?: number;\n /** An index name hint for the query. */\n hint?: string | Document;\n}\n\n/** @public */\nexport declare interface CreateCollectionOptions extends CommandOperationOptions {\n /** Create a capped collection */\n capped?: boolean;\n /** @deprecated Create an index on the _id field of the document. This option is deprecated in MongoDB 3.2+ and will be removed once no longer supported by the server. */\n autoIndexId?: boolean;\n /** The size of the capped collection in bytes */\n size?: number;\n /** The maximum number of documents in the capped collection */\n max?: number;\n /** Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag */\n flags?: number;\n /** Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection */\n storageEngine?: Document;\n /** Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation */\n validator?: Document;\n /** Determines how strictly MongoDB applies the validation rules to existing documents during an update */\n validationLevel?: string;\n /** Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted */\n validationAction?: string;\n /** Allows users to specify a default configuration for indexes when creating a collection */\n indexOptionDefaults?: Document;\n /** The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view (i.e., does not include the database name and implies the same database as the view to create) */\n viewOn?: string;\n /** An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view */\n pipeline?: Document[];\n /** A primary key factory function for generation of custom _id keys. */\n pkFactory?: PkFactory;\n /** A document specifying configuration options for timeseries collections. */\n timeseries?: TimeSeriesCollectionOptions;\n /** A document specifying configuration options for clustered collections. For MongoDB 5.3 and above. */\n clusteredIndex?: ClusteredCollectionOptions;\n /** The number of seconds after which a document in a timeseries or clustered collection expires. */\n expireAfterSeconds?: number;\n /** @experimental */\n encryptedFields?: Document;\n /**\n * If set, enables pre-update and post-update document events to be included for any\n * change streams that listen on this collection.\n */\n changeStreamPreAndPostImages?: {\n enabled: boolean;\n };\n}\n\n/** @public */\nexport declare interface CreateIndexesOptions extends Omit<CommandOperationOptions, 'writeConcern'> {\n /** Creates the index in the background, yielding whenever possible. */\n background?: boolean;\n /** Creates an unique index. */\n unique?: boolean;\n /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */\n name?: string;\n /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */\n partialFilterExpression?: Document;\n /** Creates a sparse index. */\n sparse?: boolean;\n /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */\n expireAfterSeconds?: number;\n /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */\n storageEngine?: Document;\n /** (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. */\n commitQuorum?: number | string;\n /** Specifies the index version number, either 0 or 1. */\n version?: number;\n weights?: Document;\n default_language?: string;\n language_override?: string;\n textIndexVersion?: number;\n '2dsphereIndexVersion'?: number;\n bits?: number;\n /** For geospatial indexes set the lower bound for the co-ordinates. */\n min?: number;\n /** For geospatial indexes set the high bound for the co-ordinates. */\n max?: number;\n bucketSize?: number;\n wildcardProjection?: Document;\n /** 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) */\n hidden?: boolean;\n}\n\n/**\n * @public\n * Configuration options for custom credential providers for KMS requests.\n */\nexport declare interface CredentialProviders {\n aws?: AWSCredentialProvider;\n}\n\n/** @public */\nexport declare type CSFLEKMSTlsOptions = {\n aws?: ClientEncryptionTlsOptions;\n gcp?: ClientEncryptionTlsOptions;\n kmip?: ClientEncryptionTlsOptions;\n local?: ClientEncryptionTlsOptions;\n azure?: ClientEncryptionTlsOptions;\n [key: string]: ClientEncryptionTlsOptions | undefined;\n};\n\n/* Excluded from this release type: CSOTTimeoutContext */\n\n/* Excluded from this release type: CSOTTimeoutContextOptions */\n\n/** @public */\nexport declare const CURSOR_FLAGS: readonly [\"tailable\", \"oplogReplay\", \"noCursorTimeout\", \"awaitData\", \"exhaust\", \"partial\"];\n\n/** @public */\nexport declare type CursorFlag = (typeof CURSOR_FLAGS)[number];\n\n/* Excluded from this release type: CursorResponse */\n\n/** @public */\nexport declare interface CursorStreamOptions {\n /** A transformation method applied to each document emitted by the stream */\n transform?(this: void, doc: Document): Document;\n}\n\n/* Excluded from this release type: CursorTimeoutContext */\n\n/**\n * @public\n * @experimental\n * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'`\n * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of\n * `cursor.next()`.\n * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor.\n *\n * Depending on the type of cursor being used, this option has different default values.\n * For non-tailable cursors, this value defaults to `'cursorLifetime'`\n * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by\n * definition can have an arbitrarily long lifetime.\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'});\n * for await (const doc of cursor) {\n * // process doc\n * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but\n * // will continue to iterate successfully otherwise, regardless of the number of batches.\n * }\n * ```\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' });\n * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms.\n * ```\n */\nexport declare const CursorTimeoutMode: Readonly<{\n readonly ITERATION: \"iteration\";\n readonly LIFETIME: \"cursorLifetime\";\n}>;\n\n/**\n * @public\n * @experimental\n */\nexport declare type CursorTimeoutMode = (typeof CursorTimeoutMode)[keyof typeof CursorTimeoutMode];\n\n/**\n * @public\n * The schema for a DataKey in the key vault collection.\n */\nexport declare interface DataKey {\n _id: UUID;\n version?: number;\n keyAltNames?: string[];\n keyMaterial: Binary;\n creationDate: Date;\n updateDate: Date;\n status: number;\n masterKey: Document;\n}\n\n/**\n * The **Db** class is a class that represents a MongoDB Database.\n * @public\n *\n * @example\n * ```ts\n * import { MongoClient } from '/mongodb.ts';\n *\n * interface Pet {\n * name: string;\n * kind: 'dog' | 'cat' | 'fish';\n * }\n *\n * const client = new MongoClient('mongodb://localhost:27017');\n * const db = client.db();\n *\n * // Create a collection that validates our union\n * await db.createCollection<Pet>('pets', {\n * validator: { $expr: { $in: ['$kind', ['dog', 'cat', 'fish']] } }\n * })\n * ```\n */\nexport declare class Db {\n /* Excluded from this release type: s */\n /* Excluded from this release type: client */\n static SYSTEM_NAMESPACE_COLLECTION: string;\n static SYSTEM_INDEX_COLLECTION: string;\n static SYSTEM_PROFILE_COLLECTION: string;\n static SYSTEM_USER_COLLECTION: string;\n static SYSTEM_COMMAND_COLLECTION: string;\n static SYSTEM_JS_COLLECTION: string;\n /**\n * Creates a new Db instance.\n *\n * Db name cannot contain a dot, the server may apply more restrictions when an operation is run.\n *\n * @param client - The MongoClient for the database.\n * @param databaseName - The name of the database this instance represents.\n * @param options - Optional settings for Db construction.\n */\n constructor(client: MongoClient, databaseName: string, options?: DbOptions);\n get databaseName(): string;\n get options(): DbOptions | undefined;\n /**\n * Check if a secondary can be used (because the read preference is *not* set to primary)\n */\n get secondaryOk(): boolean;\n get readConcern(): ReadConcern | undefined;\n /**\n * The current readPreference of the Db. If not explicitly defined for\n * this Db, will be inherited from the parent MongoClient\n */\n get readPreference(): ReadPreference;\n get bsonOptions(): BSONSerializeOptions;\n get writeConcern(): WriteConcern | undefined;\n get namespace(): string;\n get timeoutMS(): number | undefined;\n /**\n * Create a new collection on a server with the specified options. Use this to create capped collections.\n * More information about command options available at https://www.mongodb.com/docs/manual/reference/command/create/\n *\n * Collection namespace validation is performed server-side.\n *\n * @param name - The name of the collection to create\n * @param options - Optional settings for the command\n */\n createCollection<TSchema extends Document = Document>(name: string, options?: CreateCollectionOptions): Promise<Collection<TSchema>>;\n /**\n * Execute a command\n *\n * @remarks\n * This command does not inherit options from the MongoClient.\n *\n * The driver will ensure the following fields are attached to the command sent to the server:\n * - `lsid` - sourced from an implicit session or options.session\n * - `$readPreference` - defaults to primary or can be configured by options.readPreference\n * - `$db` - sourced from the name of this database\n *\n * If the client has a serverApi setting:\n * - `apiVersion`\n * - `apiStrict`\n * - `apiDeprecationErrors`\n *\n * When in a transaction:\n * - `readConcern` - sourced from readConcern set on the TransactionOptions\n * - `writeConcern` - sourced from writeConcern set on the TransactionOptions\n *\n * Attaching any of the above fields to the command will have no effect as the driver will overwrite the value.\n *\n * @param command - The command to run\n * @param options - Optional settings for the command\n */\n command(command: Document, options?: RunCommandOptions & Abortable): Promise<Document>;\n /**\n * Execute an aggregation framework pipeline against the database.\n *\n * @param pipeline - An array of aggregation stages to be executed\n * @param options - Optional settings for the command\n */\n aggregate<T extends Document = Document>(pipeline?: Document[], options?: AggregateOptions): AggregationCursor<T>;\n /** Return the Admin db instance */\n admin(): Admin;\n /**\n * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly.\n *\n * Collection namespace validation is performed server-side.\n *\n * @param name - the collection name we wish to access.\n * @returns return the new Collection instance\n */\n collection<TSchema extends Document = Document>(name: string, options?: CollectionOptions): Collection<TSchema>;\n /**\n * Get all the db statistics.\n *\n * @param options - Optional settings for the command\n */\n stats(options?: DbStatsOptions): Promise<Document>;\n /**\n * List all collections of this database with optional filter\n *\n * @param filter - Query to filter collections by\n * @param options - Optional settings for the command\n */\n listCollections(filter: Document, options: Exclude<ListCollectionsOptions, 'nameOnly'> & {\n nameOnly: true;\n } & Abortable): ListCollectionsCursor<Pick<CollectionInfo, 'name' | 'type'>>;\n listCollections(filter: Document, options: Exclude<ListCollectionsOptions, 'nameOnly'> & {\n nameOnly: false;\n } & Abortable): ListCollectionsCursor<CollectionInfo>;\n listCollections<T extends Pick<CollectionInfo, 'name' | 'type'> | CollectionInfo = Pick<CollectionInfo, 'name' | 'type'> | CollectionInfo>(filter?: Document, options?: ListCollectionsOptions & Abortable): ListCollectionsCursor<T>;\n /**\n * Rename a collection.\n *\n * @remarks\n * This operation does not inherit options from the MongoClient.\n *\n * @param fromCollection - Name of current collection to rename\n * @param toCollection - New name of of the collection\n * @param options - Optional settings for the command\n */\n renameCollection<TSchema extends Document = Document>(fromCollection: string, toCollection: string, options?: RenameOptions): Promise<Collection<TSchema>>;\n /**\n * Drop a collection from the database, removing it permanently. New accesses will create a new collection.\n *\n * @param name - Name of collection to drop\n * @param options - Optional settings for the command\n */\n dropCollection(name: string, options?: DropCollectionOptions): Promise<boolean>;\n /**\n * Drop a database, removing it permanently from the server.\n *\n * @param options - Optional settings for the command\n */\n dropDatabase(options?: DropDatabaseOptions): Promise<boolean>;\n /**\n * Fetch all collections for the current db.\n *\n * @param options - Optional settings for the command\n */\n collections(options?: ListCollectionsOptions): Promise<Collection[]>;\n /**\n * Creates an index on the db and collection.\n *\n * @param name - Name of the collection to create the index on.\n * @param indexSpec - Specify the field to index, or an index specification\n * @param options - Optional settings for the command\n */\n createIndex(name: string, indexSpec: IndexSpecification, options?: CreateIndexesOptions): Promise<string>;\n /**\n * Remove a user from a database\n *\n * @param username - The username to remove\n * @param options - Optional settings for the command\n */\n removeUser(username: string, options?: RemoveUserOptions): Promise<boolean>;\n /**\n * Set the current profiling level of MongoDB\n *\n * @param level - The new profiling level (off, slow_only, all).\n * @param options - Optional settings for the command\n */\n setProfilingLevel(level: ProfilingLevel, options?: SetProfilingLevelOptions): Promise<ProfilingLevel>;\n /**\n * Retrieve the current profiling Level for MongoDB\n *\n * @param options - Optional settings for the command\n */\n profilingLevel(options?: ProfilingLevelOptions): Promise<string>;\n /**\n * Retrieves this collections index info.\n *\n * @param name - The name of the collection.\n * @param options - Optional settings for the command\n */\n indexInformation(name: string, options: IndexInformationOptions & {\n full: true;\n }): Promise<IndexDescriptionInfo[]>;\n indexInformation(name: string, options: IndexInformationOptions & {\n full?: false;\n }): Promise<IndexDescriptionCompact>;\n indexInformation(name: string, options: IndexInformationOptions): Promise<IndexDescriptionCompact | IndexDescriptionInfo[]>;\n indexInformation(name: string): Promise<IndexDescriptionCompact>;\n /**\n * Create a new Change Stream, watching for new changes (insertions, updates,\n * replacements, deletions, and invalidations) in this database. Will ignore all\n * changes to system collections.\n *\n * @remarks\n * watch() accepts two generic arguments for distinct use cases:\n * - The first is to provide the schema that may be defined for all the collections within this database\n * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument\n *\n * @remarks\n * When `timeoutMS` is configured for a change stream, it will have different behaviour depending\n * on whether the change stream is in iterator mode or emitter mode. In both cases, a change\n * stream will time out if it does not receive a change event within `timeoutMS` of the last change\n * event.\n *\n * Note that if a change stream is consistently timing out when watching a collection, database or\n * client that is being changed, then this may be due to the server timing out before it can finish\n * processing the existing oplog. To address this, restart the change stream with a higher\n * `timeoutMS`.\n *\n * If the change stream times out the initial aggregate operation to establish the change stream on\n * the server, then the client will close the change stream. If the getMore calls to the server\n * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError\n * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in\n * emitter mode.\n *\n * To determine whether or not the change stream is still open following a timeout, check the\n * {@link ChangeStream.closed} getter.\n *\n * @example\n * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream.\n * The next call can just be retried after this succeeds.\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * try {\n * await changeStream.next();\n * } catch (e) {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * await changeStream.next();\n * }\n * throw e;\n * }\n * ```\n *\n * @example\n * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will\n * emit an error event that returns a MongoOperationTimeoutError, but will not close the change\n * stream unless the resume attempt fails. There is no need to re-establish change listeners as\n * this will automatically continue emitting change events once the resume attempt completes.\n *\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * changeStream.on('change', console.log);\n * changeStream.on('error', e => {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * // do nothing\n * } else {\n * changeStream.close();\n * }\n * });\n * ```\n * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.\n * @param options - Optional settings for the command\n * @typeParam TSchema - Type of the data being detected by the change stream\n * @typeParam TChange - Type of the whole change stream document emitted\n */\n watch<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream<TSchema, TChange>;\n /**\n * A low level cursor API providing basic driver functionality:\n * - ClientSession management\n * - ReadPreference for server selection\n * - Running getMores automatically when a local batch is exhausted\n *\n * @param command - The command that will start a cursor on the server.\n * @param options - Configurations for running the command, bson options will apply to getMores\n */\n runCursorCommand(command: Document, options?: RunCursorCommandOptions): RunCommandCursor;\n}\n\n/* Excluded from this release type: DB_AGGREGATE_COLLECTION */\n\n/** @public */\nexport declare interface DbOptions extends BSONSerializeOptions, WriteConcernOptions {\n /** If the database authentication is dependent on another databaseName. */\n authSource?: string;\n /** Force server to assign _id values instead of driver. */\n forceServerObjectId?: boolean;\n /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */\n readPreference?: ReadPreferenceLike;\n /** A primary key factory object for generation of custom _id keys. */\n pkFactory?: PkFactory;\n /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */\n readConcern?: ReadConcern;\n /** Should retry failed writes */\n retryWrites?: boolean;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n}\n\n/* Excluded from this release type: DbPrivate */\nexport { DBRef }\n\n/** @public */\nexport declare interface DbStatsOptions extends CommandOperationOptions {\n /** Divide the returned sizes by scale value. */\n scale?: number;\n}\n\nexport { Decimal128 }\n\n/** @public */\nexport declare interface DeleteManyModel<TSchema extends Document = Document> {\n /** The filter to limit the deleted documents. */\n filter: Filter<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n}\n\n/** @public */\nexport declare interface DeleteOneModel<TSchema extends Document = Document> {\n /** The filter to limit the deleted documents. */\n filter: Filter<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n}\n\n/** @public */\nexport declare interface DeleteOptions extends CommandOperationOptions, WriteConcernOptions {\n /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */\n ordered?: boolean;\n /** Specifies the collation to use for the operation */\n collation?: CollationOptions;\n /** Specify that the update query should only consider plans using the hinted index */\n hint?: string | Document;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n}\n\n/** @public */\nexport declare interface DeleteResult {\n /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined. */\n acknowledged: boolean;\n /** The number of documents that were deleted */\n deletedCount: number;\n}\n\n/** @public */\nexport declare interface DeleteStatement {\n /** The query that matches documents to delete. */\n q: Document;\n /** The number of matching documents to delete. */\n limit: number;\n /** Specifies the collation to use for the operation. */\n collation?: CollationOptions;\n /** A document or string that specifies the index to use to support the query predicate. */\n hint?: Hint;\n}\n\nexport { deserialize }\n\n/** @public */\nexport declare type DistinctOptions = CommandOperationOptions & {\n /**\n * @sinceServerVersion 7.1\n *\n * The index to use. Specify either the index name as a string or the index key pattern.\n * If specified, then the query system will only consider plans using the hinted index.\n *\n * If provided as a string, `hint` must be index name for an index on the collection.\n * If provided as an object, `hint` must be an index description for an index defined on the collection.\n *\n * See https://www.mongodb.com/docs/manual/reference/command/distinct/#command-fields.\n */\n hint?: Document | string;\n};\n\nexport { Document }\n\nexport { Double }\n\n/** @public */\nexport declare interface DriverInfo {\n name?: string;\n version?: string;\n platform?: string;\n}\n\n/** @public */\nexport declare interface DropCollectionOptions extends CommandOperationOptions {\n /** @experimental */\n encryptedFields?: Document;\n}\n\n/** @public */\nexport declare type DropDatabaseOptions = CommandOperationOptions;\n\n/** @public */\nexport declare type DropIndexesOptions = CommandOperationOptions;\n\n/* Excluded from this release type: Encrypter */\n\n/* Excluded from this release type: EncrypterOptions */\n\n/** @public */\nexport declare interface EndSessionOptions {\n /* Excluded from this release type: error */\n force?: boolean;\n forceClear?: boolean;\n /** Specifies the time an operation will run until it throws a timeout error */\n timeoutMS?: number;\n}\n\n/** TypeScript Omit (Exclude to be specific) does not work for objects with an \"any\" indexed type, and breaks discriminated unions @public */\nexport declare type EnhancedOmit<TRecordOrUnion, KeyUnion> = string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick<TRecordOrUnion, Exclude<keyof TRecordOrUnion, KeyUnion>> : never;\n\n/** @public */\nexport declare interface ErrorDescription extends Document {\n message?: string;\n errmsg?: string;\n $err?: string;\n errorLabels?: string[];\n errInfo?: Document;\n}\n\n/** @public */\nexport declare interface EstimatedDocumentCountOptions extends CommandOperationOptions {\n /**\n * The maximum amount of time to allow the operation to run.\n *\n * This option is sent only if the caller explicitly provides a value. The default is to not send a value.\n */\n maxTimeMS?: number;\n}\n\n/** @public */\nexport declare type EventEmitterWithState = {\n /* Excluded from this release type: stateChanged */\n};\n\n/**\n * Event description type\n * @public\n */\nexport declare type EventsDescription = Record<string, GenericListener>;\n\n/* Excluded from this release type: Explain */\n\n/**\n * @public\n *\n * A base class for any cursors that have `explain()` methods.\n */\nexport declare abstract class ExplainableCursor<TSchema> extends AbstractCursor<TSchema> {\n /** Execute the explain for the cursor */\n abstract explain(): Promise<Document>;\n abstract explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise<Document>;\n abstract explain(options: {\n timeoutMS?: number;\n }): Promise<Document>;\n abstract explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: {\n timeoutMS?: number;\n }): Promise<Document>;\n abstract explain(verbosity?: ExplainVerbosityLike | ExplainCommandOptions | {\n timeoutMS?: number;\n }, options?: {\n timeoutMS?: number;\n }): Promise<Document>;\n protected resolveExplainTimeoutOptions(verbosity?: ExplainVerbosityLike | ExplainCommandOptions | {\n timeoutMS?: number;\n }, options?: {\n timeoutMS?: number;\n }): {\n timeout?: {\n timeoutMS?: number;\n };\n explain?: ExplainVerbosityLike | ExplainCommandOptions;\n };\n}\n\n/** @public */\nexport declare interface ExplainCommandOptions {\n /** The explain verbosity for the command. */\n verbosity: ExplainVerbosity;\n /** The maxTimeMS setting for the command. */\n maxTimeMS?: number;\n}\n\n/**\n * @public\n *\n * When set, this configures an explain command. Valid values are boolean (for legacy compatibility,\n * see {@link ExplainVerbosityLike}), a string containing the explain verbosity, or an object containing the verbosity and\n * an optional maxTimeMS.\n *\n * Examples of valid usage:\n *\n * ```typescript\n * collection.find({ name: 'john doe' }, { explain: true });\n * collection.find({ name: 'john doe' }, { explain: false });\n * collection.find({ name: 'john doe' }, { explain: 'queryPlanner' });\n * collection.find({ name: 'john doe' }, { explain: { verbosity: 'queryPlanner' } });\n * ```\n *\n * maxTimeMS can be configured to limit the amount of time the server\n * spends executing an explain by providing an object:\n *\n * ```typescript\n * // limits the `explain` command to no more than 2 seconds\n * collection.find({ name: 'john doe' }, {\n * explain: {\n * verbosity: 'queryPlanner',\n * maxTimeMS: 2000\n * }\n * });\n * ```\n */\nexport declare interface ExplainOptions {\n /** Specifies the verbosity mode for the explain output. */\n explain?: ExplainVerbosityLike | ExplainCommandOptions;\n}\n\n/** @public */\nexport declare const ExplainVerbosity: Readonly<{\n readonly queryPlanner: \"queryPlanner\";\n readonly queryPlannerExtended: \"queryPlannerExtended\";\n readonly executionStats: \"executionStats\";\n readonly allPlansExecution: \"allPlansExecution\";\n}>;\n\n/** @public */\nexport declare type ExplainVerbosity = string;\n\n/**\n * For backwards compatibility, true is interpreted as \"allPlansExecution\"\n * and false as \"queryPlanner\".\n * @public\n */\nexport declare type ExplainVerbosityLike = ExplainVerbosity | boolean;\n\n/** A MongoDB filter can be some portion of the schema or a set of operators @public */\nexport declare type Filter<TSchema> = {\n [P in keyof WithId<TSchema>]?: Condition<WithId<TSchema>[P]>;\n} & RootFilterOperators<WithId<TSchema>>;\n\n/** @public */\nexport declare type FilterOperations<T> = T extends Record<string, any> ? {\n [key in keyof T]?: FilterOperators<T[key]>;\n} : FilterOperators<T>;\n\n/** @public */\nexport declare interface FilterOperators<TValue> extends NonObjectIdLikeDocument {\n $eq?: TValue;\n $gt?: TValue;\n $gte?: TValue;\n $in?: ReadonlyArray<TValue>;\n $lt?: TValue;\n $lte?: TValue;\n $ne?: TValue;\n $nin?: ReadonlyArray<TValue>;\n $not?: TValue extends string ? FilterOperators<TValue> | RegExp : FilterOperators<TValue>;\n /**\n * When `true`, `$exists` matches the documents that contain the field,\n * including documents where the field value is null.\n */\n $exists?: boolean;\n $type?: BSONType | BSONTypeAlias;\n $expr?: Record<string, any>;\n $jsonSchema?: Record<string, any>;\n $mod?: TValue extends number ? [number, number] : never;\n $regex?: TValue extends string ? RegExp | BSONRegExp | string : never;\n $options?: TValue extends string ? string : never;\n $geoIntersects?: {\n $geometry: Document;\n };\n $geoWithin?: Document;\n $near?: Document;\n $nearSphere?: Document;\n $maxDistance?: number;\n $all?: ReadonlyArray<any>;\n $elemMatch?: Document;\n $size?: TValue extends ReadonlyArray<any> ? number : never;\n $bitsAllClear?: BitwiseFilter;\n $bitsAllSet?: BitwiseFilter;\n $bitsAnyClear?: BitwiseFilter;\n $bitsAnySet?: BitwiseFilter;\n $rand?: Record<string, never>;\n}\n\n/** @public */\nexport declare class FindCursor<TSchema = any> extends ExplainableCursor<TSchema> {\n /* Excluded from this release type: cursorFilter */\n /* Excluded from this release type: numReturned */\n /* Excluded from this release type: findOptions */\n /* Excluded from this release type: __constructor */\n clone(): FindCursor<TSchema>;\n map<T>(transform: (doc: TSchema) => T): FindCursor<T>;\n /* Excluded from this release type: _initialize */\n /* Excluded from this release type: getMore */\n /**\n * Get the count of documents for this cursor\n * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead\n */\n count(options?: CountOptions): Promise<number>;\n /** Execute the explain for the cursor */\n explain(): Promise<Document>;\n explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions): Promise<Document>;\n explain(options: {\n timeoutMS?: number;\n }): Promise<Document>;\n explain(verbosity: ExplainVerbosityLike | ExplainCommandOptions, options: {\n timeoutMS?: number;\n }): Promise<Document>;\n /** Set the cursor query */\n filter(filter: Document): this;\n /**\n * Set the cursor hint\n *\n * @param hint - If specified, then the query system will only consider plans using the hinted index.\n */\n hint(hint: Hint): this;\n /**\n * Set the cursor min\n *\n * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order.\n */\n min(min: Document): this;\n /**\n * Set the cursor max\n *\n * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order.\n */\n max(max: Document): this;\n /**\n * Set the cursor returnKey.\n * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents.\n * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields.\n *\n * @param value - the returnKey value.\n */\n returnKey(value: boolean): this;\n /**\n * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection.\n *\n * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find.\n */\n showRecordId(value: boolean): this;\n /**\n * Add a query modifier to the cursor query\n *\n * @param name - The query modifier (must start with $, such as $orderby etc)\n * @param value - The modifier value.\n */\n addQueryModifier(name: string, value: string | boolean | number | Document): this;\n /**\n * Add a comment to the cursor query allowing for tracking the comment in the log.\n *\n * @param value - The comment attached to this query.\n */\n comment(value: string): this;\n /**\n * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise)\n *\n * @param value - Number of milliseconds to wait before aborting the tailed query.\n */\n maxAwaitTimeMS(value: number): this;\n /**\n * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher)\n *\n * @param value - Number of milliseconds to wait before aborting the query.\n */\n maxTimeMS(value: number): this;\n /**\n * Add a project stage to the aggregation pipeline\n *\n * @remarks\n * In order to strictly type this function you must provide an interface\n * that represents the effect of your projection on the result documents.\n *\n * By default chaining a projection to your cursor changes the returned type to the generic\n * {@link Document} type.\n * You should specify a parameterized type to have assertions on your final results.\n *\n * @example\n * ```typescript\n * // Best way\n * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true });\n * // Flexible way\n * const docs: FindCursor<Document> = cursor.project({ _id: 0, a: true });\n * ```\n *\n * @remarks\n *\n * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor,\n * it **does not** return a new instance of a cursor. This means when calling project,\n * you should always assign the result to a new variable in order to get a correctly typed cursor variable.\n * Take note of the following example:\n *\n * @example\n * ```typescript\n * const cursor: FindCursor<{ a: number; b: string }> = coll.find();\n * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true });\n * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray();\n *\n * // or always use chaining and save the final cursor\n *\n * const cursor = coll.find().project<{ a: string }>({\n * _id: 0,\n * a: { $convert: { input: '$a', to: 'string' }\n * }});\n * ```\n */\n project<T extends Document = Document>(value: Document): FindCursor<T>;\n /**\n * Sets the sort order of the cursor query.\n *\n * @param sort - The key or keys set for the sort.\n * @param direction - The direction of the sorting (1 or -1).\n */\n sort(sort: Sort | string, direction?: SortDirection): this;\n /**\n * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher)\n *\n * @remarks\n * {@link https://www.mongodb.com/docs/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation}\n */\n allowDiskUse(allow?: boolean): this;\n /**\n * Set the collation options for the cursor.\n *\n * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).\n */\n collation(value: CollationOptions): this;\n /**\n * Set the limit for the cursor.\n *\n * @param value - The limit for the cursor query.\n */\n limit(value: number): this;\n /**\n * Set the skip for the cursor.\n *\n * @param value - The skip for the cursor query.\n */\n skip(value: number): this;\n}\n\n/** @public */\nexport declare interface FindOneAndDeleteOptions extends CommandOperationOptions {\n /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/\n hint?: Document;\n /** Limits the fields to return for all matching documents. */\n projection?: Document;\n /** Determines which document the operation modifies if the query selects multiple documents. */\n sort?: Sort;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /**\n * Return the ModifyResult instead of the modified document. Defaults to false\n */\n includeResultMetadata?: boolean;\n}\n\n/** @public */\nexport declare interface FindOneAndReplaceOptions extends CommandOperationOptions {\n /** Allow driver to bypass schema validation. */\n bypassDocumentValidation?: boolean;\n /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/\n hint?: Document;\n /** Limits the fields to return for all matching documents. */\n projection?: Document;\n /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */\n returnDocument?: ReturnDocument;\n /** Determines which document the operation modifies if the query selects multiple documents. */\n sort?: Sort;\n /** Upsert the document if it does not exist. */\n upsert?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /**\n * Return the ModifyResult instead of the modified document. Defaults to false\n */\n includeResultMetadata?: boolean;\n}\n\n/** @public */\nexport declare interface FindOneAndUpdateOptions extends CommandOperationOptions {\n /** Optional list of array filters referenced in filtered positional operators */\n arrayFilters?: Document[];\n /** Allow driver to bypass schema validation. */\n bypassDocumentValidation?: boolean;\n /** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/\n hint?: Document;\n /** Limits the fields to return for all matching documents. */\n projection?: Document;\n /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */\n returnDocument?: ReturnDocument;\n /** Determines which document the operation modifies if the query selects multiple documents. */\n sort?: Sort;\n /** Upsert the document if it does not exist. */\n upsert?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /**\n * Return the ModifyResult instead of the modified document. Defaults to false\n */\n includeResultMetadata?: boolean;\n}\n\n/**\n * A builder object that is returned from {@link BulkOperationBase#find}.\n * Is used to build a write operation that involves a query filter.\n *\n * @public\n */\nexport declare class FindOperators {\n bulkOperation: BulkOperationBase;\n /* Excluded from this release type: __constructor */\n /** Add a multiple update operation to the bulk operation */\n update(updateDocument: Document | Document[]): BulkOperationBase;\n /** Add a single update operation to the bulk operation */\n updateOne(updateDocument: Document | Document[]): BulkOperationBase;\n /** Add a replace one operation to the bulk operation */\n replaceOne(replacement: Document): BulkOperationBase;\n /** Add a delete one operation to the bulk operation */\n deleteOne(): BulkOperationBase;\n /** Add a delete many operation to the bulk operation */\n delete(): BulkOperationBase;\n /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */\n upsert(): this;\n /** Specifies the collation for the query condition. */\n collation(collation: CollationOptions): this;\n /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */\n arrayFilters(arrayFilters: Document[]): this;\n /** Specifies hint for the bulk operation. */\n hint(hint: Hint): this;\n}\n\n/**\n * @public\n * @typeParam TSchema - Unused schema definition, deprecated usage, only specify `FindOptions` with no generic\n */\nexport declare interface FindOptions<TSchema extends Document = Document> extends Omit<CommandOperationOptions, 'writeConcern' | 'explain'>, AbstractCursorOptions {\n /** Sets the limit of documents returned in the query. */\n limit?: number;\n /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */\n sort?: Sort;\n /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */\n projection?: Document;\n /** Set to skip N documents ahead in your query (useful for pagination). */\n skip?: number;\n /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */\n hint?: Hint;\n /** Specify if the cursor can timeout. */\n timeout?: boolean;\n /** Specify if the cursor is tailable. */\n tailable?: boolean;\n /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */\n awaitData?: boolean;\n /** Set the batchSize for the getMoreCommand when iterating over the query results. */\n batchSize?: number;\n /** If true, returns only the index keys in the resulting documents. */\n returnKey?: boolean;\n /** The inclusive lower bound for a specific index */\n min?: Document;\n /** The exclusive upper bound for a specific index */\n max?: Document;\n /** Number of milliseconds to wait before aborting the query. */\n maxTimeMS?: number;\n /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true */\n maxAwaitTimeMS?: number;\n /** The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that. */\n noCursorTimeout?: boolean;\n /** Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). */\n collation?: CollationOptions;\n /** Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) */\n allowDiskUse?: boolean;\n /** Determines whether to close the cursor after the first batch. Defaults to false. */\n singleBatch?: boolean;\n /** For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are unavailable. */\n allowPartialResults?: boolean;\n /** Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. */\n showRecordId?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n /**\n * Option to enable an optimized code path for queries looking for a particular range of `ts` values in the oplog. Requires `tailable` to be true.\n * @deprecated Starting from MongoDB 4.4 this flag is not needed and will be ignored.\n */\n oplogReplay?: boolean;\n /**\n * Specifies the verbosity mode for the explain output.\n * @deprecated This API is deprecated in favor of `collection.find().explain()`.\n */\n explain?: ExplainOptions['explain'];\n /* Excluded from this release type: timeoutMode */\n}\n\n/** @public */\nexport declare type Flatten<Type> = Type extends ReadonlyArray<infer Item> ? Item : Type;\n\n/**\n * @public\n * Configuration options for making an AWS encryption key\n */\nexport declare interface GCPEncryptionKeyOptions {\n /**\n * GCP project ID\n */\n projectId: string;\n /**\n * Location name (e.g. \"global\")\n */\n location: string;\n /**\n * Key ring name\n */\n keyRing: string;\n /**\n * Key name\n */\n keyName: string;\n /**\n * Key version\n */\n keyVersion?: string | undefined;\n /**\n * KMS URL, defaults to `https://www.googleapis.com/auth/cloudkms`\n */\n endpoint?: string | undefined;\n}\n\n/** @public */\nexport declare type GCPKMSProviderConfiguration = {\n /**\n * The service account email to authenticate\n */\n email: string;\n /**\n * A PKCS#8 encrypted key. This can either be a base64 string or a binary representation\n */\n privateKey: string | Buffer;\n /**\n * If present, a host with optional port. E.g. \"example.com\" or \"example.com:443\".\n * Defaults to \"oauth2.googleapis.com\"\n */\n endpoint?: string | undefined;\n} | {\n /**\n * If present, an access token to authenticate with GCP.\n */\n accessToken: string;\n};\n\n/** @public */\nexport declare type GenericListener = (...args: any[]) => void;\n\n/**\n * Constructor for a streaming GridFS interface\n * @public\n */\nexport declare class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {\n /* Excluded from this release type: s */\n /**\n * When the first call to openUploadStream is made, the upload stream will\n * check to see if it needs to create the proper indexes on the chunks and\n * files collections. This event is fired either when 1) it determines that\n * no index creation is necessary, 2) when it successfully creates the\n * necessary indexes.\n * @event\n */\n static readonly INDEX: \"index\";\n constructor(db: Db, options?: GridFSBucketOptions);\n /**\n * Returns a writable stream (GridFSBucketWriteStream) for writing\n * buffers to GridFS. The stream's 'id' property contains the resulting\n * file's id.\n *\n * @param filename - The value of the 'filename' key in the files doc\n * @param options - Optional settings.\n */\n openUploadStream(filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream;\n /**\n * Returns a writable stream (GridFSBucketWriteStream) for writing\n * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting\n * file's id.\n */\n openUploadStreamWithId(id: ObjectId, filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream;\n /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */\n openDownloadStream(id: ObjectId, options?: GridFSBucketReadStreamOptions): GridFSBucketReadStream;\n /**\n * Deletes a file with the given id\n *\n * @param id - The id of the file doc\n */\n delete(id: ObjectId, options?: {\n timeoutMS: number;\n }): Promise<void>;\n /** Convenience wrapper around find on the files collection */\n find(filter?: Filter<GridFSFile>, options?: FindOptions): FindCursor<GridFSFile>;\n /**\n * Returns a readable stream (GridFSBucketReadStream) for streaming the\n * file with the given name from GridFS. If there are multiple files with\n * the same name, this will stream the most recent file with the given name\n * (as determined by the `uploadDate` field). You can set the `revision`\n * option to change this behavior.\n */\n openDownloadStreamByName(filename: string, options?: GridFSBucketReadStreamOptionsWithRevision): GridFSBucketReadStream;\n /**\n * Renames the file with the given _id to the given string\n *\n * @param id - the id of the file to rename\n * @param filename - new name for the file\n */\n rename(id: ObjectId, filename: string, options?: {\n timeoutMS: number;\n }): Promise<void>;\n /** Removes this bucket's files collection, followed by its chunks collection. */\n drop(options?: {\n timeoutMS: number;\n }): Promise<void>;\n}\n\n/** @public */\nexport declare type GridFSBucketEvents = {\n index(): void;\n};\n\n/** @public */\nexport declare interface GridFSBucketOptions extends WriteConcernOptions {\n /** The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. */\n bucketName?: string;\n /** Number of bytes stored in each chunk. Defaults to 255KB */\n chunkSizeBytes?: number;\n /** Read preference to be passed to read operations */\n readPreference?: ReadPreference;\n /**\n * @experimental\n * Specifies the lifetime duration of a gridFS stream. If any async operations are in progress\n * when this timeout expires, the stream will throw a timeout error.\n */\n timeoutMS?: number;\n}\n\n/* Excluded from this release type: GridFSBucketPrivate */\n\n/**\n * A readable stream that enables you to read buffers from GridFS.\n *\n * Do not instantiate this class directly. Use `openDownloadStream()` instead.\n * @public\n */\nexport declare class GridFSBucketReadStream extends Readable {\n /* Excluded from this release type: s */\n /**\n * Fires when the stream loaded the file document corresponding to the provided id.\n * @event\n */\n static readonly FILE: \"file\";\n /* Excluded from this release type: __constructor */\n /* Excluded from this release type: _read */\n /**\n * Sets the 0-based offset in bytes to start streaming from. Throws\n * an error if this stream has entered flowing mode\n * (e.g. if you've already called `on('data')`)\n *\n * @param start - 0-based offset in bytes to start streaming from\n */\n start(start?: number): this;\n /**\n * Sets the 0-based offset in bytes to start streaming from. Throws\n * an error if this stream has entered flowing mode\n * (e.g. if you've already called `on('data')`)\n *\n * @param end - Offset in bytes to stop reading at\n */\n end(end?: number): this;\n /**\n * Marks this stream as aborted (will never push another `data` event)\n * and kills the underlying cursor. Will emit the 'end' event, and then\n * the 'close' event once the cursor is successfully killed.\n */\n abort(): Promise<void>;\n}\n\n/** @public */\nexport declare interface GridFSBucketReadStreamOptions {\n sort?: Sort;\n skip?: number;\n /**\n * 0-indexed non-negative byte offset from the beginning of the file\n */\n start?: number;\n /**\n * 0-indexed non-negative byte offset to the end of the file contents\n * to be returned by the stream. `end` is non-inclusive\n */\n end?: number;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n}\n\n/** @public */\nexport declare interface GridFSBucketReadStreamOptionsWithRevision extends GridFSBucketReadStreamOptions {\n /** The revision number relative to the oldest file with the given filename. 0\n * gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the\n * newest. */\n revision?: number;\n}\n\n/* Excluded from this release type: GridFSBucketReadStreamPrivate */\n\n/**\n * A writable stream that enables you to write buffers to GridFS.\n *\n * Do not instantiate this class directly. Use `openUploadStream()` instead.\n * @public\n */\nexport declare class GridFSBucketWriteStream extends Writable {\n bucket: GridFSBucket;\n /** A Collection instance where the file's chunks are stored */\n chunks: Collection<GridFSChunk>;\n /** A Collection instance where the file's GridFSFile document is stored */\n files: Collection<GridFSFile>;\n /** The name of the file */\n filename: string;\n /** Options controlling the metadata inserted along with the file */\n options: GridFSBucketWriteStreamOptions;\n /** Indicates the stream is finished uploading */\n done: boolean;\n /** The ObjectId used for the `_id` field on the GridFSFile document */\n id: ObjectId;\n /** The number of bytes that each chunk will be limited to */\n chunkSizeBytes: number;\n /** Space used to store a chunk currently being inserted */\n bufToStore: Buffer;\n /** Accumulates the number of bytes inserted as the stream uploads chunks */\n length: number;\n /** Accumulates the number of chunks inserted as the stream uploads file contents */\n n: number;\n /** Tracks the current offset into the buffered bytes being uploaded */\n pos: number;\n /** Contains a number of properties indicating the current state of the stream */\n state: {\n /** If set the stream has ended */\n streamEnd: boolean;\n /** Indicates the number of chunks that still need to be inserted to exhaust the current buffered data */\n outstandingRequests: number;\n /** If set an error occurred during insertion */\n errored: boolean;\n /** If set the stream was intentionally aborted */\n aborted: boolean;\n };\n /** The write concern setting to be used with every insert operation */\n writeConcern?: WriteConcern;\n /**\n * The document containing information about the inserted file.\n * This property is defined _after_ the finish event has been emitted.\n * It will remain `null` if an error occurs.\n *\n * @example\n * ```ts\n * fs.createReadStream('file.txt')\n * .pipe(bucket.openUploadStream('file.txt'))\n * .on('finish', function () {\n * console.log(this.gridFSFile)\n * })\n * ```\n */\n gridFSFile: GridFSFile | null;\n /* Excluded from this release type: timeoutContext */\n /* Excluded from this release type: __constructor */\n /* Excluded from this release type: _construct */\n /* Excluded from this release type: _write */\n /* Excluded from this release type: _final */\n /**\n * Places this write stream into an aborted state (all future writes fail)\n * and deletes all chunks that have already been written.\n */\n abort(): Promise<void>;\n}\n\n/** @public */\nexport declare interface GridFSBucketWriteStreamOptions extends WriteConcernOptions {\n /** Overwrite this bucket's chunkSizeBytes for this file */\n chunkSizeBytes?: number;\n /** Custom file id for the GridFS file. */\n id?: ObjectId;\n /** Object to store in the file document's `metadata` field */\n metadata?: Document;\n /**\n * String to store in the file document's `contentType` field.\n * @deprecated Will be removed in the next major version. Add a contentType field to the metadata document instead.\n */\n contentType?: string;\n /**\n * Array of strings to store in the file document's `aliases` field.\n * @deprecated Will be removed in the next major version. Add an aliases field to the metadata document instead.\n */\n aliases?: string[];\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n}\n\n/** @public */\nexport declare interface GridFSChunk {\n _id: ObjectId;\n files_id: ObjectId;\n n: number;\n data: Buffer | Uint8Array;\n}\n\n/** @public */\nexport declare interface GridFSFile {\n _id: ObjectId;\n length: number;\n chunkSize: number;\n filename: string;\n metadata?: Document;\n uploadDate: Date;\n /** @deprecated Will be removed in the next major version. */\n contentType?: string;\n /** @deprecated Will be removed in the next major version. */\n aliases?: string[];\n}\n\n/** @public */\nexport declare const GSSAPICanonicalizationValue: Readonly<{\n readonly on: true;\n readonly off: false;\n readonly none: \"none\";\n readonly forward: \"forward\";\n readonly forwardAndReverse: \"forwardAndReverse\";\n}>;\n\n/** @public */\nexport declare type GSSAPICanonicalizationValue = (typeof GSSAPICanonicalizationValue)[keyof typeof GSSAPICanonicalizationValue];\n\n/* Excluded from this release type: HandshakeDocument */\n\n/** @public */\nexport declare interface HedgeOptions {\n /** Explicitly enable or disable hedged reads. */\n enabled?: boolean;\n}\n\n/** @public */\nexport declare type Hint = string | Document;\n\n/** @public */\nexport declare class HostAddress {\n host: string | undefined;\n port: number | undefined;\n socketPath: string | undefined;\n isIPv6: boolean;\n constructor(hostString: string);\n inspect(): string;\n toString(): string;\n static fromString(this: void, s: string): HostAddress;\n static fromHostPort(host: string, port: number): HostAddress;\n static fromSrvRecord({ name, port }: SrvRecord): HostAddress;\n toHostPort(): {\n host: string;\n port: number;\n };\n}\n\n/**\n * The information returned by the server on the IDP server.\n * @public\n */\nexport declare interface IdPInfo {\n /**\n * A URL which describes the Authentication Server. This identifier should\n * be the iss of provided access tokens, and be viable for RFC8414 metadata\n * discovery and RFC9207 identification.\n */\n issuer: string;\n /** A unique client ID for this OIDC client. */\n clientId: string;\n /** A list of additional scopes to request from IdP. */\n requestScopes?: string[];\n}\n\n/**\n * The response from the IdP server with the access token and\n * optional expiration time and refresh token.\n * @public\n */\nexport declare interface IdPServerResponse {\n /** The OIDC access token. */\n accessToken: string;\n /** The time when the access token expires. For future use. */\n expiresInSeconds?: number;\n /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */\n refreshToken?: string;\n}\n\n/** @public */\nexport declare interface IndexDescription extends Pick<CreateIndexesOptions, 'background' | 'unique' | 'partialFilterExpression' | 'sparse' | 'hidden' | 'expireAfterSeconds' | 'storageEngine' | 'version' | 'weights' | 'default_language' | 'language_override' | 'textIndexVersion' | '2dsphereIndexVersion' | 'bits' | 'min' | 'max' | 'bucketSize' | 'wildcardProjection'> {\n collation?: CollationOptions;\n name?: string;\n key: {\n [key: string]: IndexDirection;\n } | Map<string, IndexDirection>;\n}\n\n/** @public */\nexport declare type IndexDescriptionCompact = Record<string, [name: string, direction: IndexDirection][]>;\n\n/**\n * @public\n * The index information returned by the listIndexes command. https://www.mongodb.com/docs/manual/reference/command/listIndexes/#mongodb-dbcommand-dbcmd.listIndexes\n */\nexport declare type IndexDescriptionInfo = Omit<IndexDescription, 'key' | 'version'> & {\n key: {\n [key: string]: IndexDirection;\n };\n v?: IndexDescription['version'];\n} & Document;\n\n/** @public */\nexport declare type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | 'hashed' | number;\n\n/** @public */\nexport declare interface IndexInformationOptions extends ListIndexesOptions {\n /**\n * When `true`, an array of index descriptions is returned.\n * When `false`, the driver returns an object that with keys corresponding to index names with values\n * corresponding to the entries of the indexes' key.\n *\n * For example, the given the following indexes:\n * ```\n * [ { name: 'a_1', key: { a: 1 } }, { name: 'b_1_c_1' , key: { b: 1, c: 1 } }]\n * ```\n *\n * When `full` is `true`, the above array is returned. When `full` is `false`, the following is returned:\n * ```\n * {\n * 'a_1': [['a', 1]],\n * 'b_1_c_1': [['b', 1], ['c', 1]],\n * }\n * ```\n */\n full?: boolean;\n}\n\n/** @public */\nexport declare type IndexSpecification = OneOrMore<string | [string, IndexDirection] | {\n [key: string]: IndexDirection;\n} | Map<string, IndexDirection>>;\n\n/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */\nexport declare type InferIdType<TSchema> = TSchema extends {\n _id: infer IdType;\n} ? Record<any, never> extends IdType ? never : IdType : TSchema extends {\n _id?: infer IdType;\n} ? unknown extends IdType ? ObjectId : IdType : ObjectId;\n\n/* Excluded from this release type: InitialCursorResponse */\n\n/** @public */\nexport declare interface InsertManyResult<TSchema = Document> {\n /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */\n acknowledged: boolean;\n /** The number of inserted documents for this operations */\n insertedCount: number;\n /** Map of the index of the inserted document to the id of the inserted document */\n insertedIds: {\n [key: number]: InferIdType<TSchema>;\n };\n}\n\n/** @public */\nexport declare interface InsertOneModel<TSchema extends Document = Document> {\n /** The document to insert. */\n document: OptionalId<TSchema>;\n}\n\n/** @public */\nexport declare interface InsertOneOptions extends CommandOperationOptions {\n /** Allow driver to bypass schema validation. */\n bypassDocumentValidation?: boolean;\n /** Force server to assign _id values instead of driver. */\n forceServerObjectId?: boolean;\n}\n\n/** @public */\nexport declare interface InsertOneResult<TSchema = Document> {\n /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */\n acknowledged: boolean;\n /** 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 */\n insertedId: InferIdType<TSchema>;\n}\n\nexport { Int32 }\n\n/** @public */\nexport declare type IntegerType = number | Int32 | Long | bigint;\n\n/* Excluded from this release type: InternalAbstractCursorOptions */\n\n/** @public */\nexport declare type IsAny<Type, ResultIfAny, ResultIfNotAny> = true extends false & Type ? ResultIfAny : ResultIfNotAny;\n\n/**\n * Helper types for dot-notation filter attributes\n */\n/** @public */\nexport declare type Join<T extends unknown[], D extends string> = T extends [] ? '' : T extends [string | number] ? `${T[0]}` : T extends [string | number, ...infer R] ? `${T[0]}${D}${Join<R, D>}` : string;\n\n/* Excluded from this release type: JSTypeOf */\n\n/* Excluded from this release type: kDecorateResult */\n\n/** @public */\nexport declare type KeysOfAType<TSchema, Type> = {\n [key in keyof TSchema]: NonNullable<TSchema[key]> extends Type ? key : never;\n}[keyof TSchema];\n\n/** @public */\nexport declare type KeysOfOtherType<TSchema, Type> = {\n [key in keyof TSchema]: NonNullable<TSchema[key]> extends Type ? never : key;\n}[keyof TSchema];\n\n/**\n * @public\n * Configuration options for making a KMIP encryption key\n */\nexport declare interface KMIPEncryptionKeyOptions {\n /**\n * keyId is the KMIP Unique Identifier to a 96 byte KMIP Secret Data managed object.\n *\n * If keyId is omitted, a random 96 byte KMIP Secret Data managed object will be created.\n */\n keyId?: string;\n /**\n * Host with optional port.\n */\n endpoint?: string;\n /**\n * If true, this key should be decrypted by the KMIP server.\n *\n * Requires `mongodb-client-encryption>=6.0.1`.\n */\n delegated?: boolean;\n}\n\n/** @public */\nexport declare interface KMIPKMSProviderConfiguration {\n /**\n * The output endpoint string.\n * The endpoint consists of a hostname and port separated by a colon.\n * E.g. \"example.com:123\". A port is always present.\n */\n endpoint?: string;\n}\n\n/**\n * @public\n * Configuration options that are used by specific KMS providers during key generation, encryption, and decryption.\n *\n * Named KMS providers _are not supported_ for automatic KMS credential fetching.\n */\nexport declare interface KMSProviders {\n /**\n * Configuration options for using 'aws' as your KMS provider\n */\n aws?: AWSKMSProviderConfiguration | Record<string, never>;\n [key: `aws:${string}`]: AWSKMSProviderConfiguration;\n /**\n * Configuration options for using 'local' as your KMS provider\n */\n local?: LocalKMSProviderConfiguration;\n [key: `local:${string}`]: LocalKMSProviderConfiguration;\n /**\n * Configuration options for using 'kmip' as your KMS provider\n */\n kmip?: KMIPKMSProviderConfiguration;\n [key: `kmip:${string}`]: KMIPKMSProviderConfiguration;\n /**\n * Configuration options for using 'azure' as your KMS provider\n */\n azure?: AzureKMSProviderConfiguration | Record<string, never>;\n [key: `azure:${string}`]: AzureKMSProviderConfiguration;\n /**\n * Configuration options for using 'gcp' as your KMS provider\n */\n gcp?: GCPKMSProviderConfiguration | Record<string, never>;\n [key: `gcp:${string}`]: GCPKMSProviderConfiguration;\n}\n\n/* Excluded from this release type: LegacyTimeoutContext */\n\n/* Excluded from this release type: LegacyTimeoutContextOptions */\n\n/** @public */\nexport declare const LEGAL_TCP_SOCKET_OPTIONS: readonly [\"autoSelectFamily\", \"autoSelectFamilyAttemptTimeout\", \"family\", \"hints\", \"localAddress\", \"localPort\", \"lookup\"];\n\n/** @public */\nexport declare const LEGAL_TLS_SOCKET_OPTIONS: readonly [\"allowPartialTrustChain\", \"ALPNProtocols\", \"ca\", \"cert\", \"checkServerIdentity\", \"ciphers\", \"crl\", \"ecdhCurve\", \"key\", \"minDHSize\", \"passphrase\", \"pfx\", \"rejectUnauthorized\", \"secureContext\", \"secureProtocol\", \"servername\", \"session\"];\n\n/* Excluded from this release type: List */\n\n/** @public */\nexport declare class ListCollectionsCursor<T extends Pick<CollectionInfo, 'name' | 'type'> | CollectionInfo = Pick<CollectionInfo, 'name' | 'type'> | CollectionInfo> extends AbstractCursor<T> {\n parent: Db;\n filter: Document;\n options?: ListCollectionsOptions & Abortable;\n constructor(db: Db, filter: Document, options?: ListCollectionsOptions & Abortable);\n clone(): ListCollectionsCursor<T>;\n /* Excluded from this release type: _initialize */\n}\n\n/** @public */\nexport declare interface ListCollectionsOptions extends Omit<CommandOperationOptions, 'writeConcern'>, Abortable {\n /** Since 4.0: If true, will only return the collection name in the response, and will omit additional info */\n nameOnly?: boolean;\n /** Since 4.0: If true and nameOnly is true, allows a user without the required privilege (i.e. listCollections action on the database) to run the command when access control is enforced. */\n authorizedCollections?: boolean;\n /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */\n batchSize?: number;\n /* Excluded from this release type: timeoutMode */\n /* Excluded from this release type: timeoutContext */\n}\n\n/** @public */\nexport declare interface ListDatabasesOptions extends CommandOperationOptions {\n /** A query predicate that determines which databases are listed */\n filter?: Document;\n /** A flag to indicate whether the command should return just the database names, or return both database names and size information */\n nameOnly?: boolean;\n /** A flag that determines which databases are returned based on the user privileges when access control is enabled */\n authorizedDatabases?: boolean;\n}\n\n/** @public */\nexport declare interface ListDatabasesResult {\n databases: ({\n name: string;\n sizeOnDisk?: number;\n empty?: boolean;\n } & Document)[];\n totalSize?: number;\n totalSizeMb?: number;\n ok: 1 | 0;\n}\n\n/** @public */\nexport declare class ListIndexesCursor extends AbstractCursor {\n parent: Collection;\n options?: ListIndexesOptions;\n constructor(collection: Collection, options?: ListIndexesOptions);\n clone(): ListIndexesCursor;\n /* Excluded from this release type: _initialize */\n}\n\n/** @public */\nexport declare type ListIndexesOptions = AbstractCursorOptions & {\n /* Excluded from this release type: omitMaxTimeMS */\n};\n\n/** @public */\nexport declare class ListSearchIndexesCursor extends AggregationCursor<{\n name: string;\n}> {\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare type ListSearchIndexesOptions = Omit<AggregateOptions, 'readConcern' | 'writeConcern'>;\n\n/** @public */\nexport declare interface LocalKMSProviderConfiguration {\n /**\n * The master key used to encrypt/decrypt data keys.\n * A 96-byte long Buffer or base64 encoded string.\n */\n key: Binary | Uint8Array | string;\n}\n\n/** @public */\nexport declare interface Log extends Record<string, any> {\n t: Date;\n c: MongoLoggableComponent;\n s: SeverityLevel;\n message?: string;\n}\n\n/** @public */\nexport declare interface LogComponentSeveritiesClientOptions {\n /** Optional severity level for command component */\n command?: SeverityLevel;\n /** Optional severity level for topology component */\n topology?: SeverityLevel;\n /** Optional severity level for server selection component */\n serverSelection?: SeverityLevel;\n /** Optional severity level for connection component */\n connection?: SeverityLevel;\n /** Optional severity level for client component */\n client?: SeverityLevel;\n /** Optional default severity level to be used if any of the above are unset */\n default?: SeverityLevel;\n}\n\n/* Excluded from this release type: LogConvertible */\n\n/* Excluded from this release type: Loggable */\n\n/* Excluded from this release type: LoggableCommandFailedEvent */\n\n/* Excluded from this release type: LoggableCommandSucceededEvent */\n\n/* Excluded from this release type: LoggableEvent */\n\n/* Excluded from this release type: LoggableServerHeartbeatFailedEvent */\n\n/* Excluded from this release type: LoggableServerHeartbeatStartedEvent */\n\n/* Excluded from this release type: LoggableServerHeartbeatSucceededEvent */\nexport { Long }\n\n/** @public */\nexport declare type MatchKeysAndValues<TSchema> = Readonly<Partial<TSchema>> & Record<string, any>;\n\nexport { MaxKey }\n\n/* Excluded from this release type: MessageHeader */\nexport { MinKey }\n\n/** @public */\nexport declare interface ModifyResult<TSchema = Document> {\n value: WithId<TSchema> | null;\n lastErrorObject?: Document;\n ok: 0 | 1;\n}\n\n/** @public */\nexport declare const MONGO_CLIENT_EVENTS: readonly [\"connectionPoolCreated\", \"connectionPoolReady\", \"connectionPoolCleared\", \"connectionPoolClosed\", \"connectionCreated\", \"connectionReady\", \"connectionClosed\", \"connectionCheckOutStarted\", \"connectionCheckOutFailed\", \"connectionCheckedOut\", \"connectionCheckedIn\", \"commandStarted\", \"commandSucceeded\", \"commandFailed\", \"serverOpening\", \"serverClosed\", \"serverDescriptionChanged\", \"topologyOpening\", \"topologyClosed\", \"topologyDescriptionChanged\", \"error\", \"timeout\", \"close\", \"serverHeartbeatStarted\", \"serverHeartbeatSucceeded\", \"serverHeartbeatFailed\"];\n\n/**\n * An error generated when the driver API is used incorrectly\n *\n * @privateRemarks\n * Should **never** be directly instantiated\n *\n * @public\n * @category Error\n */\nexport declare class MongoAPIError extends MongoDriverError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * A error generated when the user attempts to authenticate\n * via AWS, but fails\n *\n * @public\n * @category Error\n */\nexport declare class MongoAWSError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * A error generated when the user attempts to authenticate\n * via Azure, but fails.\n *\n * @public\n * @category Error\n */\nexport declare class MongoAzureError extends MongoOIDCError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when a batch command is re-executed after one of the commands in the batch\n * has failed\n *\n * @public\n * @category Error\n */\nexport declare class MongoBatchReExecutionError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * An error indicating an unsuccessful Bulk Write\n * @public\n * @category Error\n */\nexport declare class MongoBulkWriteError extends MongoServerError {\n result: BulkWriteResult;\n writeErrors: OneOrMore<WriteError>;\n err?: WriteConcernError;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(error: {\n message: string;\n code: number;\n writeErrors?: WriteError[];\n } | WriteConcernError | AnyError, result: BulkWriteResult);\n get name(): string;\n /** Number of documents inserted. */\n get insertedCount(): number;\n /** Number of documents matched for update. */\n get matchedCount(): number;\n /** Number of documents modified. */\n get modifiedCount(): number;\n /** Number of documents deleted. */\n get deletedCount(): number;\n /** Number of documents upserted. */\n get upsertedCount(): number;\n /** Inserted document generated Id's, hash key is the index of the originating operation */\n get insertedIds(): {\n [key: number]: any;\n };\n /** Upserted document generated Id's, hash key is the index of the originating operation */\n get upsertedIds(): {\n [key: number]: any;\n };\n}\n\n/**\n * An error generated when a ChangeStream operation fails to execute.\n *\n * @public\n * @category Error\n */\nexport declare class MongoChangeStreamError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * The **MongoClient** class is a class that allows for making Connections to MongoDB.\n * @public\n *\n * @remarks\n * The programmatically provided options take precedence over the URI options.\n *\n * @example\n * ```ts\n * import { MongoClient } from '/mongodb.ts';\n *\n * // Enable command monitoring for debugging\n * const client = new MongoClient('mongodb://localhost:27017', { monitorCommands: true });\n *\n * client.on('commandStarted', started => console.log(started));\n * client.db().collection('pets');\n * await client.insertOne({ name: 'spot', kind: 'dog' });\n * ```\n */\nexport declare class MongoClient extends TypedEventEmitter<MongoClientEvents> implements AsyncDisposable_2 {\n /* Excluded from this release type: s */\n /* Excluded from this release type: topology */\n /* Excluded from this release type: mongoLogger */\n /* Excluded from this release type: connectionLock */\n /* Excluded from this release type: closeLock */\n /**\n * The consolidate, parsed, transformed and merged options.\n */\n readonly options: Readonly<Omit<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert'>> & Pick<MongoOptions, 'monitorCommands' | 'ca' | 'crl' | 'key' | 'cert'>;\n constructor(url: string, options?: MongoClientOptions);\n /* Excluded from this release type: [Symbol.asyncDispose] */\n /* Excluded from this release type: asyncDispose */\n /* Excluded from this release type: checkForNonGenuineHosts */\n get serverApi(): Readonly<ServerApi | undefined>;\n /* Excluded from this release type: monitorCommands */\n /* Excluded from this release type: monitorCommands */\n /* Excluded from this release type: autoEncrypter */\n get readConcern(): ReadConcern | undefined;\n get writeConcern(): WriteConcern | undefined;\n get readPreference(): ReadPreference;\n get bsonOptions(): BSONSerializeOptions;\n get timeoutMS(): number | undefined;\n /**\n * Executes a client bulk write operation, available on server 8.0+.\n * @param models - The client bulk write models.\n * @param options - The client bulk write options.\n * @returns A ClientBulkWriteResult for acknowledged writes and ok: 1 for unacknowledged writes.\n */\n bulkWrite<SchemaMap extends Record<string, Document> = Record<string, Document>>(models: ReadonlyArray<ClientBulkWriteModel<SchemaMap>>, options?: ClientBulkWriteOptions): Promise<ClientBulkWriteResult>;\n /**\n * Connect to MongoDB using a url\n *\n * @remarks\n * Calling `connect` is optional since the first operation you perform will call `connect` if it's needed.\n * `timeoutMS` will bound the time any operation can take before throwing a timeout error.\n * However, when the operation being run is automatically connecting your `MongoClient` the `timeoutMS` will not apply to the time taken to connect the MongoClient.\n * This means the time to setup the `MongoClient` does not count against `timeoutMS`.\n * If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.\n *\n * @remarks\n * The driver will look up corresponding SRV and TXT records if the connection string starts with `mongodb+srv://`.\n * If those look ups throw a DNS Timeout error, the driver will retry the look up once.\n *\n * @see docs.mongodb.org/manual/reference/connection-string/\n */\n connect(): Promise<this>;\n /* Excluded from this release type: _connect */\n /**\n * Cleans up client-side resources used by the MongoCLient and . This includes:\n *\n * - Closes all open, unused connections (see note).\n * - Ends all in-use sessions with {@link ClientSession#endSession|ClientSession.endSession()}.\n * - Ends all unused sessions server-side.\n * - Cleans up any resources being used for auto encryption if auto encryption is enabled.\n *\n * @remarks Any in-progress operations are not killed and any connections used by in progress operations\n * will be cleaned up lazily as operations finish.\n *\n * @param force - Force close, emitting no events\n */\n close(force?: boolean): Promise<void>;\n private _close;\n /**\n * Create a new Db instance sharing the current socket connections.\n *\n * @param dbName - The name of the database we want to use. If not provided, use database name from connection string.\n * @param options - Optional settings for Db construction\n */\n db(dbName?: string, options?: DbOptions): Db;\n /**\n * Connect to MongoDB using a url\n *\n * @remarks\n * Calling `connect` is optional since the first operation you perform will call `connect` if it's needed.\n * `timeoutMS` will bound the time any operation can take before throwing a timeout error.\n * However, when the operation being run is automatically connecting your `MongoClient` the `timeoutMS` will not apply to the time taken to connect the MongoClient.\n * This means the time to setup the `MongoClient` does not count against `timeoutMS`.\n * If you are using `timeoutMS` we recommend connecting your client explicitly in advance of any operation to avoid this inconsistent execution time.\n *\n * @remarks\n * The programmatically provided options take precedence over the URI options.\n *\n * @remarks\n * The driver will look up corresponding SRV and TXT records if the connection string starts with `mongodb+srv://`.\n * If those look ups throw a DNS Timeout error, the driver will retry the look up once.\n *\n * @see https://www.mongodb.com/docs/manual/reference/connection-string/\n */\n static connect(url: string, options?: MongoClientOptions): Promise<MongoClient>;\n /**\n * Creates a new ClientSession. When using the returned session in an operation\n * a corresponding ServerSession will be created.\n *\n * @remarks\n * A ClientSession instance may only be passed to operations being performed on the same\n * MongoClient it was started from.\n */\n startSession(options?: ClientSessionOptions): ClientSession;\n /**\n * A convenience method for creating and handling the clean up of a ClientSession.\n * The session will always be ended when the executor finishes.\n *\n * @param executor - An executor function that all operations using the provided session must be invoked in\n * @param options - optional settings for the session\n */\n withSession<T = any>(executor: WithSessionCallback<T>): Promise<T>;\n withSession<T = any>(options: ClientSessionOptions, executor: WithSessionCallback<T>): Promise<T>;\n /**\n * Create a new Change Stream, watching for new changes (insertions, updates,\n * replacements, deletions, and invalidations) in this cluster. Will ignore all\n * changes to system collections, as well as the local, admin, and config databases.\n *\n * @remarks\n * watch() accepts two generic arguments for distinct use cases:\n * - The first is to provide the schema that may be defined for all the data within the current cluster\n * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument\n *\n * @remarks\n * When `timeoutMS` is configured for a change stream, it will have different behaviour depending\n * on whether the change stream is in iterator mode or emitter mode. In both cases, a change\n * stream will time out if it does not receive a change event within `timeoutMS` of the last change\n * event.\n *\n * Note that if a change stream is consistently timing out when watching a collection, database or\n * client that is being changed, then this may be due to the server timing out before it can finish\n * processing the existing oplog. To address this, restart the change stream with a higher\n * `timeoutMS`.\n *\n * If the change stream times out the initial aggregate operation to establish the change stream on\n * the server, then the client will close the change stream. If the getMore calls to the server\n * time out, then the change stream will be left open, but will throw a MongoOperationTimeoutError\n * when in iterator mode and emit an error event that returns a MongoOperationTimeoutError in\n * emitter mode.\n *\n * To determine whether or not the change stream is still open following a timeout, check the\n * {@link ChangeStream.closed} getter.\n *\n * @example\n * In iterator mode, if a next() call throws a timeout error, it will attempt to resume the change stream.\n * The next call can just be retried after this succeeds.\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * try {\n * await changeStream.next();\n * } catch (e) {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * await changeStream.next();\n * }\n * throw e;\n * }\n * ```\n *\n * @example\n * In emitter mode, if the change stream goes `timeoutMS` without emitting a change event, it will\n * emit an error event that returns a MongoOperationTimeoutError, but will not close the change\n * stream unless the resume attempt fails. There is no need to re-establish change listeners as\n * this will automatically continue emitting change events once the resume attempt completes.\n *\n * ```ts\n * const changeStream = collection.watch([], { timeoutMS: 100 });\n * changeStream.on('change', console.log);\n * changeStream.on('error', e => {\n * if (e instanceof MongoOperationTimeoutError && !changeStream.closed) {\n * // do nothing\n * } else {\n * changeStream.close();\n * }\n * });\n * ```\n * @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.\n * @param options - Optional settings for the command\n * @typeParam TSchema - Type of the data being detected by the change stream\n * @typeParam TChange - Type of the whole change stream document emitted\n */\n watch<TSchema extends Document = Document, TChange extends Document = ChangeStreamDocument<TSchema>>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream<TSchema, TChange>;\n}\n\n/* Excluded from this release type: MongoClientAuthProviders */\n\n/**\n * An error indicating that an error occurred when processing bulk write results.\n *\n * @public\n * @category Error\n */\nexport declare class MongoClientBulkWriteCursorError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error indicating that an error occurred when executing the bulk write.\n *\n * @public\n * @category Error\n */\nexport declare class MongoClientBulkWriteError extends MongoServerError {\n /**\n * Write concern errors that occurred while executing the bulk write. This list may have\n * multiple items if more than one server command was required to execute the bulk write.\n */\n writeConcernErrors: Document[];\n /**\n * Errors that occurred during the execution of individual write operations. This map will\n * contain at most one entry if the bulk write was ordered.\n */\n writeErrors: Map<number, ClientBulkWriteError>;\n /**\n * The results of any successful operations that were performed before the error was\n * encountered.\n */\n partialResult?: ClientBulkWriteResult;\n /**\n * Initialize the client bulk write error.\n * @param message - The error message.\n */\n constructor(message: ErrorDescription);\n get name(): string;\n}\n\n/**\n * An error indicating that an error occurred on the client when executing a client bulk write.\n *\n * @public\n * @category Error\n */\nexport declare class MongoClientBulkWriteExecutionError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/** @public */\nexport declare type MongoClientEvents = Pick<TopologyEvents, (typeof MONGO_CLIENT_EVENTS)[number]> & {\n open(mongoClient: MongoClient): void;\n};\n\n/**\n * Describes all possible URI query options for the mongo client\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/connection-string\n */\nexport declare interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeConnectionOptions {\n /** Specifies the name of the replica set, if the mongod is a member of a replica set. */\n replicaSet?: string;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n /** Enables or disables TLS/SSL for the connection. */\n tls?: boolean;\n /** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */\n ssl?: boolean;\n /** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key. */\n tlsCertificateKeyFile?: string;\n /** Specifies the password to de-crypt the tlsCertificateKeyFile. */\n tlsCertificateKeyFilePassword?: string;\n /** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */\n tlsCAFile?: string;\n /** Specifies the location of a local CRL .pem file that contains the client revokation list. */\n tlsCRLFile?: string;\n /** Bypasses validation of the certificates presented by the mongod/mongos instance */\n tlsAllowInvalidCertificates?: boolean;\n /** Disables hostname validation of the certificate presented by the mongod/mongos instance. */\n tlsAllowInvalidHostnames?: boolean;\n /** Disables various certificate validations. */\n tlsInsecure?: boolean;\n /** The time in milliseconds to attempt a connection before timing out. */\n connectTimeoutMS?: number;\n /** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */\n socketTimeoutMS?: number;\n /** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */\n compressors?: CompressorName[] | string;\n /** An integer that specifies the compression level if using zlib for network compression. */\n zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined;\n /** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */\n srvMaxHosts?: number;\n /**\n * Modifies the srv URI to look like:\n *\n * `_{srvServiceName}._tcp.{hostname}.{domainname}`\n *\n * Querying this DNS URI is expected to respond with SRV records\n */\n srvServiceName?: string;\n /** The maximum number of connections in the connection pool. */\n maxPoolSize?: number;\n /** The minimum number of connections in the connection pool. */\n minPoolSize?: number;\n /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */\n maxConnecting?: number;\n /** The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */\n maxIdleTimeMS?: number;\n /** The maximum time in milliseconds that a thread can wait for a connection to become available. */\n waitQueueTimeoutMS?: number;\n /** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */\n readConcern?: ReadConcernLike;\n /** The level of isolation */\n readConcernLevel?: ReadConcernLevel;\n /** Specifies the read preferences for this connection */\n readPreference?: ReadPreferenceMode | ReadPreference;\n /** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */\n maxStalenessSeconds?: number;\n /** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */\n readPreferenceTags?: TagSet[];\n /** The auth settings for when connection to server. */\n auth?: Auth;\n /** Specify the database name associated with the user’s credentials. */\n authSource?: string;\n /** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */\n authMechanism?: AuthMechanism;\n /** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */\n authMechanismProperties?: AuthMechanismProperties;\n /** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */\n localThresholdMS?: number;\n /** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */\n serverSelectionTimeoutMS?: number;\n /** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */\n heartbeatFrequencyMS?: number;\n /** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */\n minHeartbeatFrequencyMS?: number;\n /** The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections */\n appName?: string;\n /** Enables retryable reads. */\n retryReads?: boolean;\n /** Enable retryable writes. */\n retryWrites?: boolean;\n /** Allow a driver to force a Single topology type with a connection string containing one host */\n directConnection?: boolean;\n /** Instruct the driver it is connecting to a load balancer fronting a mongos like service */\n loadBalanced?: boolean;\n /**\n * The write concern w value\n * @deprecated Please use the `writeConcern` option instead\n */\n w?: W;\n /**\n * The write concern timeout\n * @deprecated Please use the `writeConcern` option instead\n */\n wtimeoutMS?: number;\n /**\n * The journal write concern\n * @deprecated Please use the `writeConcern` option instead\n */\n journal?: boolean;\n /**\n * A MongoDB WriteConcern, which describes the level of acknowledgement\n * requested from MongoDB for write operations.\n *\n * @see https://www.mongodb.com/docs/manual/reference/write-concern/\n */\n writeConcern?: WriteConcern | WriteConcernSettings;\n /** TCP Connection no delay */\n noDelay?: boolean;\n /** Force server to assign `_id` values instead of driver */\n forceServerObjectId?: boolean;\n /** A primary key factory function for generation of custom `_id` keys */\n pkFactory?: PkFactory;\n /** Enable command monitoring for this client */\n monitorCommands?: boolean;\n /** Server API version */\n serverApi?: ServerApi | ServerApiVersion;\n /**\n * Optionally enable in-use auto encryption\n *\n * @remarks\n * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error\n * (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.md#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts.\n *\n * Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://www.mongodb.com/docs/manual/reference/command/listCollections/#dbcmd.listCollections).\n *\n * If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true:\n * - AutoEncryptionOptions.keyVaultClient is not passed.\n * - AutoEncryptionOptions.bypassAutomaticEncryption is false.\n *\n * If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted.\n */\n autoEncryption?: AutoEncryptionOptions;\n /** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */\n driverInfo?: DriverInfo;\n /** Configures a Socks5 proxy host used for creating TCP connections. */\n proxyHost?: string;\n /** Configures a Socks5 proxy port used for creating TCP connections. */\n proxyPort?: number;\n /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */\n proxyUsername?: string;\n /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */\n proxyPassword?: string;\n /** Instructs the driver monitors to use a specific monitoring mode */\n serverMonitoringMode?: ServerMonitoringMode;\n /**\n * @public\n * Specifies the destination of the driver's logging. The default is stderr.\n */\n mongodbLogPath?: 'stderr' | 'stdout' | MongoDBLogWritable;\n /**\n * @public\n * Enable logging level per component or use `default` to control any unset components.\n */\n mongodbLogComponentSeverities?: LogComponentSeveritiesClientOptions;\n /**\n * @public\n * All BSON documents are stringified to EJSON. This controls the maximum length of those strings.\n * It is defaulted to 1000.\n */\n mongodbLogMaxDocumentLength?: number;\n /* Excluded from this release type: srvPoller */\n /* Excluded from this release type: connectionType */\n /* Excluded from this release type: __skipPingOnConnect */\n}\n\n/* Excluded from this release type: MongoClientPrivate */\n\n/**\n * An error generated when a feature that is not enabled or allowed for the current server\n * configuration is used\n *\n *\n * @public\n * @category Error\n */\nexport declare class MongoCompatibilityError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * A representation of the credentials used by MongoDB\n * @public\n */\nexport declare class MongoCredentials {\n /** The username used for authentication */\n readonly username: string;\n /** The password used for authentication */\n readonly password: string;\n /** The database that the user should authenticate against */\n readonly source: string;\n /** The method used to authenticate */\n readonly mechanism: AuthMechanism;\n /** Special properties used by some types of auth mechanisms */\n readonly mechanismProperties: AuthMechanismProperties;\n constructor(options: MongoCredentialsOptions);\n /** Determines if two MongoCredentials objects are equivalent */\n equals(other: MongoCredentials): boolean;\n /**\n * If the authentication mechanism is set to \"default\", resolves the authMechanism\n * based on the server version and server supported sasl mechanisms.\n *\n * @param hello - A hello response from the server\n */\n resolveAuthMechanism(hello: Document | null): MongoCredentials;\n validate(): void;\n static merge(creds: MongoCredentials | undefined, options: Partial<MongoCredentialsOptions>): MongoCredentials;\n}\n\n/** @public */\nexport declare interface MongoCredentialsOptions {\n username?: string;\n password: string;\n source: string;\n db?: string;\n mechanism?: AuthMechanism;\n mechanismProperties: AuthMechanismProperties;\n}\n\n/**\n * @public\n * An error indicating that mongodb-client-encryption failed to auto-refresh Azure KMS credentials.\n */\nexport declare class MongoCryptAzureKMSRequestError extends MongoCryptError {\n /** The body of the http response that failed, if present. */\n body?: Document;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, body?: Document);\n get name(): string;\n}\n\n/**\n * @public\n * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys\n */\nexport declare class MongoCryptCreateDataKeyError extends MongoCryptError {\n encryptedFields: Document;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(encryptedFields: Document, { cause }: {\n cause: Error;\n });\n get name(): string;\n}\n\n/**\n * @public\n * An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create a collection\n */\nexport declare class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {\n encryptedFields: Document;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(encryptedFields: Document, { cause }: {\n cause: Error;\n });\n get name(): string;\n}\n\n/* Excluded from this release type: MongocryptdManager */\n\n/**\n * @public\n * An error indicating that something went wrong specifically with MongoDB Client Encryption\n */\nexport declare class MongoCryptError extends MongoError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * @public\n *\n * An error indicating an invalid argument was provided to an encryption API.\n */\nexport declare class MongoCryptInvalidArgumentError extends MongoCryptError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/** @public */\nexport declare class MongoCryptKMSRequestNetworkTimeoutError extends MongoCryptError {\n get name(): string;\n}\n\n/**\n * An error thrown when an attempt is made to read from a cursor that has been exhausted\n *\n * @public\n * @category Error\n */\nexport declare class MongoCursorExhaustedError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * An error thrown when the user attempts to add options to a cursor that has already been\n * initialized\n *\n * @public\n * @category Error\n */\nexport declare class MongoCursorInUseError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * @public\n *\n * A class representing a collection's namespace. This class enforces (through Typescript) that\n * the `collection` portion of the namespace is defined and should only be\n * used in scenarios where this can be guaranteed.\n */\nexport declare class MongoDBCollectionNamespace extends MongoDBNamespace {\n collection: string;\n constructor(db: string, collection: string);\n static fromString(namespace?: string): MongoDBCollectionNamespace;\n}\n\n/**\n * @public\n *\n * A custom destination for structured logging messages.\n */\nexport declare interface MongoDBLogWritable {\n /**\n * This function will be called for every enabled log message.\n *\n * It can be sync or async:\n * - If it is synchronous it will block the driver from proceeding until this method returns.\n * - If it is asynchronous the driver will not await the returned promise. It will attach fulfillment handling (`.then`).\n * If the promise rejects the logger will write an error message to stderr and stop functioning.\n * If the promise resolves the driver proceeds to the next log message (or waits for new ones to occur).\n *\n * Tips:\n * - We recommend writing an async `write` function that _never_ rejects.\n * Instead handle logging errors as necessary to your use case and make the write function a noop, until it can be recovered.\n * - The Log messages are structured but **subject to change** since the intended purpose is informational.\n * Program against this defensively and err on the side of stringifying whatever is passed in to write in some form or another.\n *\n */\n write(log: Log): PromiseLike<unknown> | unknown;\n}\n\n/** @public */\nexport declare class MongoDBNamespace {\n db: string;\n collection?: string | undefined;\n /**\n * Create a namespace object\n *\n * @param db - database name\n * @param collection - collection name\n */\n constructor(db: string, collection?: string | undefined);\n toString(): string;\n withCollection(collection: string): MongoDBCollectionNamespace;\n static fromString(namespace?: string): MongoDBNamespace;\n}\n\n/* Excluded from this release type: MongoDBResponse */\n\n/* Excluded from this release type: MongoDBResponseConstructor */\n\n/**\n * An error generated when the driver fails to decompress\n * data received from the server.\n *\n * @public\n * @category Error\n */\nexport declare class MongoDecompressionError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated by the driver\n *\n * @public\n * @category Error\n */\nexport declare class MongoDriverError extends MongoError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * @public\n * @category Error\n *\n * @privateRemarks\n * mongodb-client-encryption has a dependency on this error, it uses the constructor with a string argument\n */\nexport declare class MongoError extends Error {\n /* Excluded from this release type: errorLabelSet */\n get errorLabels(): string[];\n /**\n * This is a number in MongoServerError and a string in MongoDriverError\n * @privateRemarks\n * Define the type override on the subclasses when we can use the override keyword\n */\n code?: number | string;\n topologyVersion?: TopologyVersion;\n connectionGeneration?: number;\n cause?: Error;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n /* Excluded from this release type: buildErrorMessage */\n get name(): string;\n /** Legacy name for server error responses */\n get errmsg(): string;\n /**\n * Checks the error to see if it has an error label\n *\n * @param label - The error label to check for\n * @returns returns true if the error has the provided error label\n */\n hasErrorLabel(label: string): boolean;\n addErrorLabel(label: string): void;\n}\n\n/** @public */\nexport declare const MongoErrorLabel: Readonly<{\n readonly RetryableWriteError: \"RetryableWriteError\";\n readonly TransientTransactionError: \"TransientTransactionError\";\n readonly UnknownTransactionCommitResult: \"UnknownTransactionCommitResult\";\n readonly ResumableChangeStreamError: \"ResumableChangeStreamError\";\n readonly HandshakeError: \"HandshakeError\";\n readonly ResetPool: \"ResetPool\";\n readonly PoolRequstedRetry: \"PoolRequstedRetry\";\n readonly InterruptInUseConnections: \"InterruptInUseConnections\";\n readonly NoWritesPerformed: \"NoWritesPerformed\";\n}>;\n\n/** @public */\nexport declare type MongoErrorLabel = (typeof MongoErrorLabel)[keyof typeof MongoErrorLabel];\n\n/**\n * An error generated when the user attempts to operate\n * on a session that has expired or has been closed.\n *\n * @public\n * @category Error\n */\nexport declare class MongoExpiredSessionError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * A error generated when the user attempts to authenticate\n * via GCP, but fails.\n *\n * @public\n * @category Error\n */\nexport declare class MongoGCPError extends MongoOIDCError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when a malformed or invalid chunk is\n * encountered when reading from a GridFSStream.\n *\n * @public\n * @category Error\n */\nexport declare class MongoGridFSChunkError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/** An error generated when a GridFSStream operation fails to execute.\n *\n * @public\n * @category Error\n */\nexport declare class MongoGridFSStreamError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when the user supplies malformed or unexpected arguments\n * or when a required argument or field is not provided.\n *\n *\n * @public\n * @category Error\n */\nexport declare class MongoInvalidArgumentError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * A error generated when the user attempts to authenticate\n * via Kerberos, but fails to connect to the Kerberos client.\n *\n * @public\n * @category Error\n */\nexport declare class MongoKerberosError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/** @public */\nexport declare const MongoLoggableComponent: Readonly<{\n readonly COMMAND: \"command\";\n readonly TOPOLOGY: \"topology\";\n readonly SERVER_SELECTION: \"serverSelection\";\n readonly CONNECTION: \"connection\";\n readonly CLIENT: \"client\";\n}>;\n\n/** @public */\nexport declare type MongoLoggableComponent = (typeof MongoLoggableComponent)[keyof typeof MongoLoggableComponent];\n\n/* Excluded from this release type: MongoLogger */\n\n/* Excluded from this release type: MongoLoggerEnvOptions */\n\n/* Excluded from this release type: MongoLoggerMongoClientOptions */\n\n/* Excluded from this release type: MongoLoggerOptions */\n\n/**\n * An error generated when the user fails to provide authentication credentials before attempting\n * to connect to a mongo server instance.\n *\n *\n * @public\n * @category Error\n */\nexport declare class MongoMissingCredentialsError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when a required module or dependency is not present in the local environment\n *\n * @public\n * @category Error\n */\nexport declare class MongoMissingDependencyError extends MongoAPIError {\n dependencyName: string;\n /** @remarks This property is assigned in the `Error` constructor. */\n cause: Error;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options: {\n cause: Error;\n dependencyName: string;\n });\n get name(): string;\n}\n\n/**\n * An error indicating an issue with the network, including TCP errors and timeouts.\n * @public\n * @category Error\n */\nexport declare class MongoNetworkError extends MongoError {\n /* Excluded from this release type: beforeHandshake */\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: MongoNetworkErrorOptions);\n get name(): string;\n}\n\n/** @public */\nexport declare interface MongoNetworkErrorOptions {\n /** Indicates the timeout happened before a connection handshake completed */\n beforeHandshake?: boolean;\n cause?: Error;\n}\n\n/**\n * An error indicating a network timeout occurred\n * @public\n * @category Error\n *\n * @privateRemarks\n * mongodb-client-encryption has a dependency on this error with an instanceof check\n */\nexport declare class MongoNetworkTimeoutError extends MongoNetworkError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: MongoNetworkErrorOptions);\n get name(): string;\n}\n\n/**\n * An error thrown when the user attempts to operate on a database or collection through a MongoClient\n * that has not yet successfully called the \"connect\" method\n *\n * @public\n * @category Error\n */\nexport declare class MongoNotConnectedError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * A error generated when the user attempts to authenticate\n * via OIDC callbacks, but fails.\n *\n * @public\n * @category Error\n */\nexport declare class MongoOIDCError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * @public\n * @category Error\n *\n * The `MongoOperationTimeoutError` class represents an error that occurs when an operation could not be completed within the specified `timeoutMS`.\n * It is generated by the driver in support of the \"client side operation timeout\" feature so inherits from `MongoDriverError`.\n * When `timeoutMS` is enabled `MongoServerError`s relating to `MaxTimeExpired` errors will be converted to `MongoOperationTimeoutError`\n *\n * @example\n * ```ts\n * try {\n * await blogs.insertOne(blogPost, { timeoutMS: 60_000 })\n * } catch (error) {\n * if (error instanceof MongoOperationTimeoutError) {\n * console.log(`Oh no! writer's block!`, error);\n * }\n * }\n * ```\n */\nexport declare class MongoOperationTimeoutError extends MongoDriverError {\n get name(): string;\n}\n\n/**\n * Parsed Mongo Client Options.\n *\n * User supplied options are documented by `MongoClientOptions`.\n *\n * **NOTE:** The client's options parsing is subject to change to support new features.\n * This type is provided to aid with inspection of options after parsing, it should not be relied upon programmatically.\n *\n * Options are sourced from:\n * - connection string\n * - options object passed to the MongoClient constructor\n * - file system (ex. tls settings)\n * - environment variables\n * - DNS SRV records and TXT records\n *\n * Not all options may be present after client construction as some are obtained from asynchronous operations.\n *\n * @public\n */\nexport declare interface MongoOptions extends Required<Pick<MongoClientOptions, 'autoEncryption' | 'connectTimeoutMS' | 'directConnection' | 'driverInfo' | 'forceServerObjectId' | 'minHeartbeatFrequencyMS' | 'heartbeatFrequencyMS' | 'localThresholdMS' | 'maxConnecting' | 'maxIdleTimeMS' | 'maxPoolSize' | 'minPoolSize' | 'monitorCommands' | 'noDelay' | 'pkFactory' | 'raw' | 'replicaSet' | 'retryReads' | 'retryWrites' | 'serverSelectionTimeoutMS' | 'socketTimeoutMS' | 'srvMaxHosts' | 'srvServiceName' | 'tlsAllowInvalidCertificates' | 'tlsAllowInvalidHostnames' | 'tlsInsecure' | 'waitQueueTimeoutMS' | 'zlibCompressionLevel'>>, SupportedNodeConnectionOptions {\n appName?: string;\n hosts: HostAddress[];\n srvHost?: string;\n credentials?: MongoCredentials;\n readPreference: ReadPreference;\n readConcern: ReadConcern;\n loadBalanced: boolean;\n directConnection: boolean;\n serverApi: ServerApi;\n compressors: CompressorName[];\n writeConcern: WriteConcern;\n dbName: string;\n metadata: ClientMetadata;\n /* Excluded from this release type: extendedMetadata */\n /* Excluded from this release type: autoEncrypter */\n /* Excluded from this release type: tokenCache */\n proxyHost?: string;\n proxyPort?: number;\n proxyUsername?: string;\n proxyPassword?: string;\n serverMonitoringMode: ServerMonitoringMode;\n /* Excluded from this release type: connectionType */\n /* Excluded from this release type: authProviders */\n /* Excluded from this release type: encrypter */\n /* Excluded from this release type: userSpecifiedAuthSource */\n /* Excluded from this release type: userSpecifiedReplicaSet */\n /**\n * # NOTE ABOUT TLS Options\n *\n * If `tls` is provided as an option, it is equivalent to setting the `ssl` option.\n *\n * NodeJS native TLS options are passed through to the socket and retain their original types.\n *\n * ### Additional options:\n *\n * | nodejs native option | driver spec equivalent option name | driver option type |\n * |:----------------------|:----------------------------------------------|:-------------------|\n * | `ca` | `tlsCAFile` | `string` |\n * | `crl` | `tlsCRLFile` | `string` |\n * | `cert` | `tlsCertificateKeyFile` | `string` |\n * | `key` | `tlsCertificateKeyFile` | `string` |\n * | `passphrase` | `tlsCertificateKeyFilePassword` | `string` |\n * | `rejectUnauthorized` | `tlsAllowInvalidCertificates` | `boolean` |\n * | `checkServerIdentity` | `tlsAllowInvalidHostnames` | `boolean` |\n * | see note below | `tlsInsecure` | `boolean` |\n *\n * If `tlsInsecure` is set to `true`, then it will set the node native options `checkServerIdentity`\n * to a no-op and `rejectUnauthorized` to `false`.\n *\n * If `tlsInsecure` is set to `false`, then it will set the node native options `checkServerIdentity`\n * to a no-op and `rejectUnauthorized` to the inverse value of `tlsAllowInvalidCertificates`. If\n * `tlsAllowInvalidCertificates` is not set, then `rejectUnauthorized` will be set to `true`.\n *\n * ### Note on `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile`\n *\n * The files specified by the paths passed in to the `tlsCAFile`, `tlsCertificateKeyFile` and `tlsCRLFile`\n * fields are read lazily on the first call to `MongoClient.connect`. Once these files have been read and\n * the `ca`, `cert`, `crl` and `key` fields are populated, they will not be read again on subsequent calls to\n * `MongoClient.connect`. As a result, until the first call to `MongoClient.connect`, the `ca`,\n * `cert`, `crl` and `key` fields will be undefined.\n */\n tls: boolean;\n tlsCAFile?: string;\n tlsCRLFile?: string;\n tlsCertificateKeyFile?: string;\n /* Excluded from this release type: mongoLoggerOptions */\n /* Excluded from this release type: mongodbLogPath */\n timeoutMS?: number;\n /* Excluded from this release type: __skipPingOnConnect */\n}\n\n/**\n * An error used when attempting to parse a value (like a connection string)\n * @public\n * @category Error\n */\nexport declare class MongoParseError extends MongoDriverError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when the driver encounters unexpected input\n * or reaches an unexpected/invalid internal state.\n *\n * @privateRemarks\n * Should **never** be directly instantiated.\n *\n * @public\n * @category Error\n */\nexport declare class MongoRuntimeError extends MongoDriverError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * An error generated when an attempt is made to operate\n * on a closed/closing server.\n *\n * @public\n * @category Error\n */\nexport declare class MongoServerClosedError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * An error coming from the mongo server\n *\n * @public\n * @category Error\n */\nexport declare class MongoServerError extends MongoError {\n /** Raw error result document returned by server. */\n errorResponse: ErrorDescription;\n codeName?: string;\n writeConcernError?: Document;\n errInfo?: Document;\n ok?: number;\n [key: string]: any;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: ErrorDescription);\n get name(): string;\n}\n\n/**\n * An error signifying a client-side server selection error\n * @public\n * @category Error\n */\nexport declare class MongoServerSelectionError extends MongoSystemError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, reason: TopologyDescription);\n get name(): string;\n}\n\n/**\n * An error generated when a primary server is marked stale, never directly thrown\n *\n * @public\n * @category Error\n */\nexport declare class MongoStalePrimaryError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * An error signifying a general system issue\n * @public\n * @category Error\n */\nexport declare class MongoSystemError extends MongoError {\n /** An optional reason context, such as an error saved during flow of monitoring and selecting servers */\n reason?: TopologyDescription;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, reason: TopologyDescription);\n get name(): string;\n}\n\n/**\n * An error thrown when the user calls a function or method not supported on a tailable cursor\n *\n * @public\n * @category Error\n */\nexport declare class MongoTailableCursorError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * An error generated when an attempt is made to operate on a\n * dropped, or otherwise unavailable, database.\n *\n * @public\n * @category Error\n */\nexport declare class MongoTopologyClosedError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message?: string);\n get name(): string;\n}\n\n/**\n * An error generated when the user makes a mistake in the usage of transactions.\n * (e.g. attempting to commit a transaction with a readPreference other than primary)\n *\n * @public\n * @category Error\n */\nexport declare class MongoTransactionError extends MongoAPIError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string);\n get name(): string;\n}\n\n/**\n * An error generated when a **parsable** unexpected response comes from the server.\n * This is generally an error where the driver in a state expecting a certain behavior to occur in\n * the next message from MongoDB but it receives something else.\n * This error **does not** represent an issue with wire message formatting.\n *\n * #### Example\n * When an operation fails, it is the driver's job to retry it. It must perform serverSelection\n * again to make sure that it attempts the operation against a server in a good state. If server\n * selection returns a server that does not support retryable operations, this error is used.\n * This scenario is unlikely as retryable support would also have been determined on the first attempt\n * but it is possible the state change could report a selectable server that does not support retries.\n *\n * @public\n * @category Error\n */\nexport declare class MongoUnexpectedServerResponseError extends MongoRuntimeError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(message: string, options?: {\n cause?: Error;\n });\n get name(): string;\n}\n\n/**\n * An error thrown when the server reports a writeConcernError\n * @public\n * @category Error\n */\nexport declare class MongoWriteConcernError extends MongoServerError {\n /** The result document */\n result: Document;\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(result: WriteConcernErrorResult);\n get name(): string;\n}\n\n/* Excluded from this release type: Monitor */\n\n/** @public */\nexport declare type MonitorEvents = {\n serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void;\n serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void;\n serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void;\n resetServer(error?: MongoError): void;\n resetConnectionPool(): void;\n close(): void;\n} & EventEmitterWithState;\n\n/* Excluded from this release type: MonitorInterval */\n\n/* Excluded from this release type: MonitorIntervalOptions */\n\n/** @public */\nexport declare interface MonitorOptions extends Omit<ConnectionOptions, 'id' | 'generation' | 'hostAddress'> {\n connectTimeoutMS: number;\n heartbeatFrequencyMS: number;\n minHeartbeatFrequencyMS: number;\n serverMonitoringMode: ServerMonitoringMode;\n}\n\n/* Excluded from this release type: MonitorPrivate */\n\n/**\n * @public\n * returns tuple of strings (keys to be joined on '.') that represent every path into a schema\n * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/\n *\n * @remarks\n * Through testing we determined that a depth of 8 is safe for the typescript compiler\n * and provides reasonable compilation times. This number is otherwise not special and\n * should be changed if issues are found with this level of checking. Beyond this\n * depth any helpers that make use of NestedPaths should devolve to not asserting any\n * type safety on the input.\n */\nexport declare type NestedPaths<Type, Depth extends number[]> = Depth['length'] extends 8 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | {\n _bsontype: string;\n} ? [] : Type extends ReadonlyArray<infer ArrayType> ? [] | [number, ...NestedPaths<ArrayType, [...Depth, 1]>] : Type extends Map<string, any> ? [string] : Type extends object ? {\n [Key in Extract<keyof Type, string>]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray<infer ArrayType> ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [\n Key,\n ...NestedPaths<Type[Key], [...Depth, 1]>\n ] : // child is not structured the same as the parent\n [\n Key,\n ...NestedPaths<Type[Key], [...Depth, 1]>\n ] | [Key];\n}[Extract<keyof Type, string>] : [];\n\n/**\n * @public\n * returns keys (strings) for every path into a schema with a value of type\n * https://www.mongodb.com/docs/manual/tutorial/query-embedded-documents/\n */\nexport declare type NestedPathsOfType<TSchema, Type> = KeysOfAType<{\n [Property in Join<NestedPaths<TSchema, []>, '.'>]: PropertyType<TSchema, Property>;\n}, Type>;\n\n/**\n * @public\n * A type that extends Document but forbids anything that \"looks like\" an object id.\n */\nexport declare type NonObjectIdLikeDocument = {\n [key in keyof ObjectIdLike]?: never;\n} & Document;\n\n/** It avoids using fields with not acceptable types @public */\nexport declare type NotAcceptedFields<TSchema, FieldType> = {\n readonly [key in KeysOfOtherType<TSchema, FieldType>]?: never;\n};\n\n/** @public */\nexport declare type NumericType = IntegerType | Decimal128 | Double;\n\nexport { ObjectId }\n\n/**\n * The signature of the human or machine callback functions.\n * @public\n */\nexport declare type OIDCCallbackFunction = (params: OIDCCallbackParams) => Promise<OIDCResponse>;\n\n/**\n * The parameters that the driver provides to the user supplied\n * human or machine callback.\n *\n * The version number is used to communicate callback API changes that are not breaking but that\n * users may want to know about and review their implementation. Users may wish to check the version\n * number and throw an error if their expected version number and the one provided do not match.\n * @public\n */\nexport declare interface OIDCCallbackParams {\n /** Optional username. */\n username?: string;\n /** The context in which to timeout the OIDC callback. */\n timeoutContext: AbortSignal;\n /** The current OIDC API version. */\n version: 1;\n /** The IdP information returned from the server. */\n idpInfo?: IdPInfo;\n /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */\n refreshToken?: string;\n}\n\n/**\n * The response required to be returned from the machine or\n * human callback workflows' callback.\n * @public\n */\nexport declare interface OIDCResponse {\n /** The OIDC access token. */\n accessToken: string;\n /** The time when the access token expires. For future use. */\n expiresInSeconds?: number;\n /** The refresh token, if applicable, to be used by the callback to request a new token from the issuer. */\n refreshToken?: string;\n}\n\n/* Excluded from this release type: OnDemandDocument */\n\n/* Excluded from this release type: OnDemandDocumentDeserializeOptions */\n\n/** @public */\nexport declare type OneOrMore<T> = T | ReadonlyArray<T>;\n\n/** @public */\nexport declare type OnlyFieldsOfType<TSchema, FieldType = any, AssignableType = FieldType> = IsAny<TSchema[keyof TSchema], AssignableType extends FieldType ? Record<string, FieldType> : Record<string, AssignableType>, AcceptedFields<TSchema, FieldType, AssignableType> & NotAcceptedFields<TSchema, FieldType> & Record<string, AssignableType>>;\n\n/* Excluded from this release type: OpCompressedRequest */\n\n/** @public */\nexport declare interface OperationOptions extends BSONSerializeOptions {\n /** Specify ClientSession for this command */\n session?: ClientSession;\n willRetryWrite?: boolean;\n /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */\n readPreference?: ReadPreferenceLike;\n /* Excluded from this release type: bypassPinningCheck */\n omitReadPreference?: boolean;\n /* Excluded from this release type: omitMaxTimeMS */\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n}\n\n/* Excluded from this release type: OperationParent */\n\n/**\n * Represents a specific point in time on a server. Can be retrieved by using `db.command()`\n * @public\n * @see https://www.mongodb.com/docs/manual/reference/method/db.runCommand/#response\n */\nexport declare type OperationTime = Timestamp;\n\n/* Excluded from this release type: OpMsgOptions */\n\n/* Excluded from this release type: OpMsgRequest */\n\n/* Excluded from this release type: OpMsgResponse */\n\n/* Excluded from this release type: OpQueryOptions */\n\n/* Excluded from this release type: OpQueryRequest */\n\n/* Excluded from this release type: OpReply */\n\n/**\n * Add an optional _id field to an object shaped type\n * @public\n */\nexport declare type OptionalId<TSchema> = EnhancedOmit<TSchema, '_id'> & {\n _id?: InferIdType<TSchema>;\n};\n\n/**\n * Adds an optional _id field to an object shaped type, unless the _id field is required on that type.\n * In the case _id is required, this method continues to require_id.\n *\n * @public\n *\n * @privateRemarks\n * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask\n * `TSchema['_id'] extends ObjectId` which translated to \"Is the _id property ObjectId?\"\n * we instead ask \"Does ObjectId look like (have the same shape) as the _id?\"\n */\nexport declare type OptionalUnlessRequiredId<TSchema> = TSchema extends {\n _id: any;\n} ? TSchema : OptionalId<TSchema>;\n\n/** @public */\nexport declare class OrderedBulkOperation extends BulkOperationBase {\n /* Excluded from this release type: __constructor */\n addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this;\n}\n\n/** @public */\nexport declare interface PkFactory {\n createPk(): any;\n}\n\n/* Excluded from this release type: PoolState */\n\n/** @public */\nexport declare const ProfilingLevel: Readonly<{\n readonly off: \"off\";\n readonly slowOnly: \"slow_only\";\n readonly all: \"all\";\n}>;\n\n/** @public */\nexport declare type ProfilingLevel = (typeof ProfilingLevel)[keyof typeof ProfilingLevel];\n\n/** @public */\nexport declare type ProfilingLevelOptions = CommandOperationOptions;\n\n/** @public */\nexport declare type PropertyType<Type, Property extends string> = string extends Property ? unknown : Property extends keyof Type ? Type[Property] : Property extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? ArrayType : unknown : Property extends `${infer Key}.${infer Rest}` ? Key extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? PropertyType<ArrayType, Rest> : unknown : Key extends keyof Type ? Type[Key] extends Map<string, infer MapType> ? MapType : PropertyType<Type[Key], Rest> : unknown : unknown;\n\n/** @public */\nexport declare interface ProxyOptions {\n proxyHost?: string;\n proxyPort?: number;\n proxyUsername?: string;\n proxyPassword?: string;\n}\n\n/** @public */\nexport declare type PullAllOperator<TSchema> = ({\n readonly [key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: TSchema[key];\n} & NotAcceptedFields<TSchema, ReadonlyArray<any>>) & {\n readonly [key: string]: ReadonlyArray<any>;\n};\n\n/** @public */\nexport declare type PullOperator<TSchema> = ({\n readonly [key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: Partial<Flatten<TSchema[key]>> | FilterOperations<Flatten<TSchema[key]>>;\n} & NotAcceptedFields<TSchema, ReadonlyArray<any>>) & {\n readonly [key: string]: FilterOperators<any> | any;\n};\n\n/** @public */\nexport declare type PushOperator<TSchema> = ({\n readonly [key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: Flatten<TSchema[key]> | ArrayOperator<Array<Flatten<TSchema[key]>>>;\n} & NotAcceptedFields<TSchema, ReadonlyArray<any>>) & {\n readonly [key: string]: ArrayOperator<any> | any;\n};\n\n/**\n * @public\n * RangeOptions specifies index options for a Queryable Encryption field supporting \"range\" queries.\n * min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection.\n * For double and decimal128, min/max/precision must all be set, or all be unset.\n */\nexport declare interface RangeOptions {\n /** min is the minimum value for the encrypted index. Required if precision is set. */\n min?: any;\n /** max is the minimum value for the encrypted index. Required if precision is set. */\n max?: any;\n /** sparsity may be used to tune performance. must be non-negative. When omitted, a default value is used. */\n sparsity?: Long | bigint;\n /** trimFactor may be used to tune performance. must be non-negative. When omitted, a default value is used. */\n trimFactor?: Int32 | number;\n precision?: number;\n}\n\n/**\n * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties\n * of the data read from replica sets and replica set shards.\n * @public\n *\n * @see https://www.mongodb.com/docs/manual/reference/read-concern/index.html\n */\nexport declare class ReadConcern {\n level: ReadConcernLevel | string;\n /** Constructs a ReadConcern from the read concern level.*/\n constructor(level: ReadConcernLevel);\n /**\n * Construct a ReadConcern given an options object.\n *\n * @param options - The options object from which to extract the write concern.\n */\n static fromOptions(options?: {\n readConcern?: ReadConcernLike;\n level?: ReadConcernLevel;\n }): ReadConcern | undefined;\n static get MAJORITY(): 'majority';\n static get AVAILABLE(): 'available';\n static get LINEARIZABLE(): 'linearizable';\n static get SNAPSHOT(): 'snapshot';\n toJSON(): Document;\n}\n\n/** @public */\nexport declare const ReadConcernLevel: Readonly<{\n readonly local: \"local\";\n readonly majority: \"majority\";\n readonly linearizable: \"linearizable\";\n readonly available: \"available\";\n readonly snapshot: \"snapshot\";\n}>;\n\n/** @public */\nexport declare type ReadConcernLevel = (typeof ReadConcernLevel)[keyof typeof ReadConcernLevel];\n\n/** @public */\nexport declare type ReadConcernLike = ReadConcern | {\n level: ReadConcernLevel;\n} | ReadConcernLevel;\n\n/**\n * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is\n * used to construct connections.\n * @public\n *\n * @see https://www.mongodb.com/docs/manual/core/read-preference/\n */\nexport declare class ReadPreference {\n mode: ReadPreferenceMode;\n tags?: TagSet[];\n hedge?: HedgeOptions;\n maxStalenessSeconds?: number;\n minWireVersion?: number;\n static PRIMARY: \"primary\";\n static PRIMARY_PREFERRED: \"primaryPreferred\";\n static SECONDARY: \"secondary\";\n static SECONDARY_PREFERRED: \"secondaryPreferred\";\n static NEAREST: \"nearest\";\n static primary: ReadPreference;\n static primaryPreferred: ReadPreference;\n static secondary: ReadPreference;\n static secondaryPreferred: ReadPreference;\n static nearest: ReadPreference;\n /**\n * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest)\n * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary.\n * @param options - Additional read preference options\n */\n constructor(mode: ReadPreferenceMode, tags?: TagSet[], options?: ReadPreferenceOptions);\n get preference(): ReadPreferenceMode;\n static fromString(mode: string): ReadPreference;\n /**\n * Construct a ReadPreference given an options object.\n *\n * @param options - The options object from which to extract the read preference.\n */\n static fromOptions(options?: ReadPreferenceFromOptions): ReadPreference | undefined;\n /**\n * Replaces options.readPreference with a ReadPreference instance\n */\n static translate(options: ReadPreferenceLikeOptions): ReadPreferenceLikeOptions;\n /**\n * Validate if a mode is legal\n *\n * @param mode - The string representing the read preference mode.\n */\n static isValid(mode: string): boolean;\n /**\n * Validate if a mode is legal\n *\n * @param mode - The string representing the read preference mode.\n */\n isValid(mode?: string): boolean;\n /**\n * Indicates that this readPreference needs the \"SecondaryOk\" bit when sent over the wire\n * @see https://www.mongodb.com/docs/manual/reference/mongodb-wire-protocol/#op-query\n */\n secondaryOk(): boolean;\n /**\n * Check if the two ReadPreferences are equivalent\n *\n * @param readPreference - The read preference with which to check equality\n */\n equals(readPreference: ReadPreference): boolean;\n /** Return JSON representation */\n toJSON(): Document;\n}\n\n/** @public */\nexport declare interface ReadPreferenceFromOptions extends ReadPreferenceLikeOptions {\n session?: ClientSession;\n readPreferenceTags?: TagSet[];\n hedge?: HedgeOptions;\n}\n\n/** @public */\nexport declare type ReadPreferenceLike = ReadPreference | ReadPreferenceMode;\n\n/** @public */\nexport declare interface ReadPreferenceLikeOptions extends ReadPreferenceOptions {\n readPreference?: ReadPreferenceLike | {\n mode?: ReadPreferenceMode;\n preference?: ReadPreferenceMode;\n tags?: TagSet[];\n maxStalenessSeconds?: number;\n };\n}\n\n/** @public */\nexport declare const ReadPreferenceMode: Readonly<{\n readonly primary: \"primary\";\n readonly primaryPreferred: \"primaryPreferred\";\n readonly secondary: \"secondary\";\n readonly secondaryPreferred: \"secondaryPreferred\";\n readonly nearest: \"nearest\";\n}>;\n\n/** @public */\nexport declare type ReadPreferenceMode = (typeof ReadPreferenceMode)[keyof typeof ReadPreferenceMode];\n\n/** @public */\nexport declare interface ReadPreferenceOptions {\n /** Max secondary read staleness in seconds, Minimum value is 90 seconds.*/\n maxStalenessSeconds?: number;\n /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */\n hedge?: HedgeOptions;\n}\n\n/** @public */\nexport declare type RegExpOrString<T> = T extends string ? BSONRegExp | RegExp | T : T;\n\n/** @public */\nexport declare type RemoveUserOptions = CommandOperationOptions;\n\n/** @public */\nexport declare interface RenameOptions extends CommandOperationOptions {\n /** Drop the target name collection if it previously exists. */\n dropTarget?: boolean;\n /** Unclear */\n new_collection?: boolean;\n}\n\n/** @public */\nexport declare interface ReplaceOneModel<TSchema extends Document = Document> {\n /** The filter to limit the replaced document. */\n filter: Filter<TSchema>;\n /** The document with which to replace the matched document. */\n replacement: WithoutId<TSchema>;\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/** @public */\nexport declare interface ReplaceOptions extends CommandOperationOptions {\n /** If true, allows the write to opt-out of document level validation */\n bypassDocumentValidation?: boolean;\n /** Specifies a collation */\n collation?: CollationOptions;\n /** Specify that the update query should only consider plans using the hinted index */\n hint?: string | Document;\n /** When true, creates a new document if no document matches the query */\n upsert?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n}\n\n/**\n * @public\n * @deprecated Please use the ChangeStreamCursorOptions type instead.\n */\nexport declare interface ResumeOptions {\n startAtOperationTime?: Timestamp;\n batchSize?: number;\n maxAwaitTimeMS?: number;\n collation?: CollationOptions;\n readPreference?: ReadPreference;\n resumeAfter?: ResumeToken;\n startAfter?: ResumeToken;\n fullDocument?: string;\n}\n\n/**\n * Represents the logical starting point for a new ChangeStream or resuming a ChangeStream on the server.\n * @see https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-stream-resume\n * @public\n */\nexport declare type ResumeToken = unknown;\n\n/** @public */\nexport declare const ReturnDocument: Readonly<{\n readonly BEFORE: \"before\";\n readonly AFTER: \"after\";\n}>;\n\n/** @public */\nexport declare type ReturnDocument = (typeof ReturnDocument)[keyof typeof ReturnDocument];\n\n/** @public */\nexport declare interface RootFilterOperators<TSchema> extends Document {\n $and?: Filter<TSchema>[];\n $nor?: Filter<TSchema>[];\n $or?: Filter<TSchema>[];\n $text?: {\n $search: string;\n $language?: string;\n $caseSensitive?: boolean;\n $diacriticSensitive?: boolean;\n };\n $where?: string | ((this: TSchema) => boolean);\n $comment?: string | Document;\n}\n\n/* Excluded from this release type: RTTPinger */\n\n/* Excluded from this release type: RTTPingerOptions */\n\n/* Excluded from this release type: RTTSampler */\n\n/** @public */\nexport declare class RunCommandCursor extends AbstractCursor {\n readonly command: Readonly<Record<string, any>>;\n readonly getMoreOptions: {\n comment?: any;\n maxAwaitTimeMS?: number;\n batchSize?: number;\n };\n /**\n * Controls the `getMore.comment` field\n * @param comment - any BSON value\n */\n setComment(comment: any): this;\n /**\n * Controls the `getMore.maxTimeMS` field. Only valid when cursor is tailable await\n * @param maxTimeMS - the number of milliseconds to wait for new data\n */\n setMaxTimeMS(maxTimeMS: number): this;\n /**\n * Controls the `getMore.batchSize` field\n * @param batchSize - the number documents to return in the `nextBatch`\n */\n setBatchSize(batchSize: number): this;\n /** Unsupported for RunCommandCursor */\n clone(): never;\n /** Unsupported for RunCommandCursor: readConcern must be configured directly on command document */\n withReadConcern(_: ReadConcernLike): never;\n /** Unsupported for RunCommandCursor: various cursor flags must be configured directly on command document */\n addCursorFlag(_: string, __: boolean): never;\n /**\n * Unsupported for RunCommandCursor: maxTimeMS must be configured directly on command document\n */\n maxTimeMS(_: number): never;\n /** Unsupported for RunCommandCursor: batchSize must be configured directly on command document */\n batchSize(_: number): never;\n /* Excluded from this release type: db */\n /* Excluded from this release type: __constructor */\n /* Excluded from this release type: _initialize */\n /* Excluded from this release type: getMore */\n}\n\n/** @public */\nexport declare type RunCommandOptions = {\n /** Specify ClientSession for this command */\n session?: ClientSession;\n /** The read preference */\n readPreference?: ReadPreferenceLike;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error\n */\n timeoutMS?: number;\n /* Excluded from this release type: omitMaxTimeMS */\n} & BSONSerializeOptions;\n\n/** @public */\nexport declare type RunCursorCommandOptions = {\n readPreference?: ReadPreferenceLike;\n session?: ClientSession;\n /**\n * @experimental\n * Specifies the time an operation will run until it throws a timeout error. Note that if\n * `maxTimeMS` is provided in the command in addition to setting `timeoutMS` in the options, then\n * the original value of `maxTimeMS` will be overwritten.\n */\n timeoutMS?: number;\n /**\n * @public\n * @experimental\n * Specifies how `timeoutMS` is applied to the cursor. Can be either `'cursorLifeTime'` or `'iteration'`\n * When set to `'iteration'`, the deadline specified by `timeoutMS` applies to each call of\n * `cursor.next()`.\n * When set to `'cursorLifetime'`, the deadline applies to the life of the entire cursor.\n *\n * Depending on the type of cursor being used, this option has different default values.\n * For non-tailable cursors, this value defaults to `'cursorLifetime'`\n * For tailable cursors, this value defaults to `'iteration'` since tailable cursors, by\n * definition can have an arbitrarily long lifetime.\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, {timeoutMS: 100, timeoutMode: 'iteration'});\n * for await (const doc of cursor) {\n * // process doc\n * // This will throw a timeout error if any of the iterator's `next()` calls takes more than 100ms, but\n * // will continue to iterate successfully otherwise, regardless of the number of batches.\n * }\n * ```\n *\n * @example\n * ```ts\n * const cursor = collection.find({}, { timeoutMS: 1000, timeoutMode: 'cursorLifetime' });\n * const docs = await cursor.toArray(); // This entire line will throw a timeout error if all batches are not fetched and returned within 1000ms.\n * ```\n */\n timeoutMode?: CursorTimeoutMode;\n tailable?: boolean;\n awaitData?: boolean;\n} & BSONSerializeOptions;\n\n/** @public */\nexport declare type SchemaMember<T, V> = {\n [P in keyof T]?: V;\n} | {\n [key: string]: V;\n};\n\n/**\n * @public\n */\nexport declare interface SearchIndexDescription extends Document {\n /** The name of the index. */\n name?: string;\n /** The index definition. */\n definition: Document;\n /** The type of the index. Currently `search` or `vectorSearch` are supported. */\n type?: string;\n}\n\n/** @public */\nexport declare interface SelectServerOptions {\n readPreference?: ReadPreferenceLike;\n /** How long to block for server selection before throwing an error */\n serverSelectionTimeoutMS?: number;\n session?: ClientSession;\n operationName: string;\n previousServer?: ServerDescription;\n /* Excluded from this release type: timeoutContext */\n}\n\nexport { serialize }\n\n/* Excluded from this release type: Server */\n\n/* Excluded from this release type: SERVER_CLOSED */\n\n/* Excluded from this release type: SERVER_DESCRIPTION_CHANGED */\n\n/* Excluded from this release type: SERVER_HEARTBEAT_FAILED */\n\n/* Excluded from this release type: SERVER_HEARTBEAT_STARTED */\n\n/* Excluded from this release type: SERVER_HEARTBEAT_SUCCEEDED */\n\n/* Excluded from this release type: SERVER_OPENING */\n\n/* Excluded from this release type: SERVER_SELECTION_FAILED */\n\n/* Excluded from this release type: SERVER_SELECTION_STARTED */\n\n/* Excluded from this release type: SERVER_SELECTION_SUCCEEDED */\n\n/** @public */\nexport declare interface ServerApi {\n version: ServerApiVersion;\n strict?: boolean;\n deprecationErrors?: boolean;\n}\n\n/** @public */\nexport declare const ServerApiVersion: Readonly<{\n readonly v1: \"1\";\n}>;\n\n/** @public */\nexport declare type ServerApiVersion = (typeof ServerApiVersion)[keyof typeof ServerApiVersion];\n\n/** @public */\nexport declare class ServerCapabilities {\n maxWireVersion: number;\n minWireVersion: number;\n constructor(hello: Document);\n get hasAggregationCursor(): boolean;\n get hasWriteCommands(): boolean;\n get hasTextSearch(): boolean;\n get hasAuthCommands(): boolean;\n get hasListCollectionsCommand(): boolean;\n get hasListIndexesCommand(): boolean;\n get supportsSnapshotReads(): boolean;\n get commandsTakeWriteConcern(): boolean;\n get commandsTakeCollation(): boolean;\n}\n\n/**\n * Emitted when server is closed.\n * @public\n * @category Event\n */\nexport declare class ServerClosedEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /** The address (host/port pair) of the server */\n address: string;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/* Excluded from this release type: ServerCommandOptions */\n\n/**\n * The client's view of a single server, based on the most recent hello outcome.\n *\n * Internal type, not meant to be directly instantiated\n * @public\n */\nexport declare class ServerDescription {\n address: string;\n type: ServerType;\n hosts: string[];\n passives: string[];\n arbiters: string[];\n tags: TagSet;\n error: MongoError | null;\n topologyVersion: TopologyVersion | null;\n minWireVersion: number;\n maxWireVersion: number;\n roundTripTime: number;\n /** The minimum measurement of the last 10 measurements of roundTripTime that have been collected */\n minRoundTripTime: number;\n lastUpdateTime: number;\n lastWriteDate: number;\n me: string | null;\n primary: string | null;\n setName: string | null;\n setVersion: number | null;\n electionId: ObjectId | null;\n logicalSessionTimeoutMinutes: number | null;\n /** The max message size in bytes for the server. */\n maxMessageSizeBytes: number | null;\n /** The max number of writes in a bulk write command. */\n maxWriteBatchSize: number | null;\n /** The max bson object size. */\n maxBsonObjectSize: number | null;\n /** Indicates server is a mongocryptd instance. */\n iscryptd: boolean;\n $clusterTime?: ClusterTime;\n /* Excluded from this release type: __constructor */\n get hostAddress(): HostAddress;\n get allHosts(): string[];\n /** Is this server available for reads*/\n get isReadable(): boolean;\n /** Is this server data bearing */\n get isDataBearing(): boolean;\n /** Is this server available for writes */\n get isWritable(): boolean;\n get host(): string;\n get port(): number;\n /**\n * Determines if another `ServerDescription` is equal to this one per the rules defined in the SDAM specification.\n * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md\n */\n equals(other?: ServerDescription | null): boolean;\n}\n\n/**\n * Emitted when server description changes, but does NOT include changes to the RTT.\n * @public\n * @category Event\n */\nexport declare class ServerDescriptionChangedEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /** The address (host/port pair) of the server */\n address: string;\n /** The previous server description */\n previousDescription: ServerDescription;\n /** The new server description */\n newDescription: ServerDescription;\n name: \"serverDescriptionChanged\";\n /* Excluded from this release type: __constructor */\n}\n\n/* Excluded from this release type: ServerDescriptionOptions */\n\n/** @public */\nexport declare type ServerEvents = {\n serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void;\n serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void;\n serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void;\n /* Excluded from this release type: connect */\n descriptionReceived(description: ServerDescription): void;\n closed(): void;\n ended(): void;\n} & ConnectionPoolEvents & EventEmitterWithState;\n\n/**\n * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception.\n * @public\n * @category Event\n */\nexport declare class ServerHeartbeatFailedEvent {\n /** The connection id for the command */\n connectionId: string;\n /** The execution time of the event in ms */\n duration: number;\n /** The command failure */\n failure: Error;\n /** Is true when using the streaming protocol */\n awaited: boolean;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * Emitted when the server monitor’s hello command is started - immediately before\n * the hello command is serialized into raw BSON and written to the socket.\n *\n * @public\n * @category Event\n */\nexport declare class ServerHeartbeatStartedEvent {\n /** The connection id for the command */\n connectionId: string;\n /** Is true when using the streaming protocol */\n awaited: boolean;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * Emitted when the server monitor’s hello succeeds.\n * @public\n * @category Event\n */\nexport declare class ServerHeartbeatSucceededEvent {\n /** The connection id for the command */\n connectionId: string;\n /** The execution time of the event in ms */\n duration: number;\n /** The command reply */\n reply: Document;\n /** Is true when using the streaming protocol */\n awaited: boolean;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare const ServerMonitoringMode: Readonly<{\n readonly auto: \"auto\";\n readonly poll: \"poll\";\n readonly stream: \"stream\";\n}>;\n\n/** @public */\nexport declare type ServerMonitoringMode = (typeof ServerMonitoringMode)[keyof typeof ServerMonitoringMode];\n\n/**\n * Emitted when server is initialized.\n * @public\n * @category Event\n */\nexport declare class ServerOpeningEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /** The address (host/port pair) of the server */\n address: string;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/* Excluded from this release type: ServerOptions */\n\n/* Excluded from this release type: ServerPrivate */\n\n/* Excluded from this release type: ServerSelectionCallback */\n\n/* Excluded from this release type: ServerSelectionEvent */\n\n/* Excluded from this release type: ServerSelectionFailedEvent */\n\n/* Excluded from this release type: ServerSelectionRequest */\n\n/* Excluded from this release type: ServerSelectionStartedEvent */\n\n/* Excluded from this release type: ServerSelectionSucceededEvent */\n\n/* Excluded from this release type: ServerSelector */\n\n/**\n * Reflects the existence of a session on the server. Can be reused by the session pool.\n * WARNING: not meant to be instantiated directly. For internal use only.\n * @public\n */\nexport declare class ServerSession {\n id: ServerSessionId;\n lastUse: number;\n txnNumber: number;\n isDirty: boolean;\n /* Excluded from this release type: __constructor */\n /**\n * Determines if the server session has timed out.\n *\n * @param sessionTimeoutMinutes - The server's \"logicalSessionTimeoutMinutes\"\n */\n hasTimedOut(sessionTimeoutMinutes: number): boolean;\n}\n\n/** @public */\nexport declare type ServerSessionId = {\n id: Binary;\n};\n\n/* Excluded from this release type: ServerSessionPool */\n\n/**\n * An enumeration of server types we know about\n * @public\n */\nexport declare const ServerType: Readonly<{\n readonly Standalone: \"Standalone\";\n readonly Mongos: \"Mongos\";\n readonly PossiblePrimary: \"PossiblePrimary\";\n readonly RSPrimary: \"RSPrimary\";\n readonly RSSecondary: \"RSSecondary\";\n readonly RSArbiter: \"RSArbiter\";\n readonly RSOther: \"RSOther\";\n readonly RSGhost: \"RSGhost\";\n readonly Unknown: \"Unknown\";\n readonly LoadBalancer: \"LoadBalancer\";\n}>;\n\n/** @public */\nexport declare type ServerType = (typeof ServerType)[keyof typeof ServerType];\n\n/** @public */\nexport declare type SetFields<TSchema> = ({\n readonly [key in KeysOfAType<TSchema, ReadonlyArray<any> | undefined>]?: OptionalId<Flatten<TSchema[key]>> | AddToSetOperators<Array<OptionalId<Flatten<TSchema[key]>>>>;\n} & IsAny<TSchema[keyof TSchema], object, NotAcceptedFields<TSchema, ReadonlyArray<any> | undefined>>) & {\n readonly [key: string]: AddToSetOperators<any> | any;\n};\n\n/** @public */\nexport declare type SetProfilingLevelOptions = CommandOperationOptions;\n\n/**\n * @public\n * Severity levels align with unix syslog.\n * Most typical driver functions will log to debug.\n */\nexport declare const SeverityLevel: Readonly<{\n readonly EMERGENCY: \"emergency\";\n readonly ALERT: \"alert\";\n readonly CRITICAL: \"critical\";\n readonly ERROR: \"error\";\n readonly WARNING: \"warn\";\n readonly NOTICE: \"notice\";\n readonly INFORMATIONAL: \"info\";\n readonly DEBUG: \"debug\";\n readonly TRACE: \"trace\";\n readonly OFF: \"off\";\n}>;\n\n/** @public */\nexport declare type SeverityLevel = (typeof SeverityLevel)[keyof typeof SeverityLevel];\n\n/** @public */\nexport declare type Sort = string | Exclude<SortDirection, {\n $meta: string;\n}> | string[] | {\n [key: string]: SortDirection;\n} | Map<string, SortDirection> | [string, SortDirection][] | [string, SortDirection];\n\n/** @public */\nexport declare type SortDirection = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending' | {\n $meta: string;\n};\n\n/* Excluded from this release type: SortDirectionForCmd */\n\n/* Excluded from this release type: SortForCmd */\n\n/* Excluded from this release type: SrvPoller */\n\n/* Excluded from this release type: SrvPollerEvents */\n\n/* Excluded from this release type: SrvPollerOptions */\n\n/* Excluded from this release type: SrvPollingEvent */\n\n/* Excluded from this release type: StateMachineExecutable */\n\n/** @public */\nexport declare type Stream = Socket | TLSSocket;\n\n/** @public */\nexport declare class StreamDescription {\n address: string;\n type: ServerType;\n minWireVersion?: number;\n maxWireVersion?: number;\n maxBsonObjectSize: number;\n maxMessageSizeBytes: number;\n maxWriteBatchSize: number;\n compressors: CompressorName[];\n compressor?: CompressorName;\n logicalSessionTimeoutMinutes?: number;\n loadBalanced: boolean;\n __nodejs_mock_server__?: boolean;\n zlibCompressionLevel?: number;\n serverConnectionId: bigint | null;\n hello: Document | null;\n constructor(address: string, options?: StreamDescriptionOptions);\n receiveResponse(response: Document | null): void;\n parseServerConnectionID(serverConnectionId: number | Double | bigint | Long): bigint;\n}\n\n/** @public */\nexport declare interface StreamDescriptionOptions {\n compressors?: CompressorName[];\n logicalSessionTimeoutMinutes?: number;\n loadBalanced: boolean;\n}\n\n/**\n * @public\n * @experimental\n */\nexport declare type StrictFilter<TSchema> = Partial<TSchema> | ({\n [Property in Join<NestedPaths<WithId<TSchema>, []>, '.'>]?: Condition<PropertyType<WithId<TSchema>, Property>>;\n} & RootFilterOperators<WithId<TSchema>>);\n\n/**\n * @public\n * @experimental\n */\nexport declare type StrictMatchKeysAndValues<TSchema> = Readonly<{\n [Property in Join<NestedPaths<TSchema, []>, '.'>]?: PropertyType<TSchema, Property>;\n} & {\n [Property in `${NestedPathsOfType<TSchema, any[]>}.$${`[${string}]` | ''}`]?: ArrayElement<PropertyType<TSchema, Property extends `${infer Key}.$${string}` ? Key : never>>;\n} & {\n [Property in `${NestedPathsOfType<TSchema, Record<string, any>[]>}.$${`[${string}]` | ''}.${string}`]?: any;\n} & Document>;\n\n/**\n * @public\n * @experimental\n */\nexport declare type StrictUpdateFilter<TSchema> = {\n $currentDate?: OnlyFieldsOfType<TSchema, Date | Timestamp, true | {\n $type: 'date' | 'timestamp';\n }>;\n $inc?: OnlyFieldsOfType<TSchema, NumericType | undefined>;\n $min?: StrictMatchKeysAndValues<TSchema>;\n $max?: StrictMatchKeysAndValues<TSchema>;\n $mul?: OnlyFieldsOfType<TSchema, NumericType | undefined>;\n $rename?: Record<string, string>;\n $set?: StrictMatchKeysAndValues<TSchema>;\n $setOnInsert?: StrictMatchKeysAndValues<TSchema>;\n $unset?: OnlyFieldsOfType<TSchema, any, '' | true | 1>;\n $addToSet?: SetFields<TSchema>;\n $pop?: OnlyFieldsOfType<TSchema, ReadonlyArray<any>, 1 | -1>;\n $pull?: PullOperator<TSchema>;\n $push?: PushOperator<TSchema>;\n $pullAll?: PullAllOperator<TSchema>;\n $bit?: OnlyFieldsOfType<TSchema, NumericType | undefined, {\n and: IntegerType;\n } | {\n or: IntegerType;\n } | {\n xor: IntegerType;\n }>;\n} & Document;\n\n/** @public */\nexport declare type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & SupportedTLSSocketOptions & SupportedSocketOptions;\n\n/** @public */\nexport declare type SupportedSocketOptions = Pick<TcpNetConnectOpts & {\n autoSelectFamily?: boolean;\n autoSelectFamilyAttemptTimeout?: number;\n}, (typeof LEGAL_TCP_SOCKET_OPTIONS)[number]>;\n\n/** @public */\nexport declare type SupportedTLSConnectionOptions = Pick<ConnectionOptions_2 & {\n allowPartialTrustChain?: boolean;\n}, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>;\n\n/** @public */\nexport declare type SupportedTLSSocketOptions = Pick<TLSSocketOptions, Extract<keyof TLSSocketOptions, (typeof LEGAL_TLS_SOCKET_OPTIONS)[number]>>;\n\n/** @public */\nexport declare type TagSet = {\n [key: string]: string;\n};\n\n/* Excluded from this release type: Timeout */\n\n/* Excluded from this release type: TimeoutContext */\n\n/* Excluded from this release type: TimeoutContextOptions */\n\n/** @public\n * Configuration options for timeseries collections\n * @see https://www.mongodb.com/docs/manual/core/timeseries-collections/\n */\nexport declare interface TimeSeriesCollectionOptions extends Document {\n timeField: string;\n metaField?: string;\n granularity?: 'seconds' | 'minutes' | 'hours' | string;\n bucketMaxSpanSeconds?: number;\n bucketRoundingSeconds?: number;\n}\n\nexport { Timestamp }\n\n/* Excluded from this release type: TokenCache */\n\n/* Excluded from this release type: Topology */\n\n/* Excluded from this release type: TOPOLOGY_CLOSED */\n\n/* Excluded from this release type: TOPOLOGY_DESCRIPTION_CHANGED */\n\n/* Excluded from this release type: TOPOLOGY_OPENING */\n\n/**\n * Emitted when topology is closed.\n * @public\n * @category Event\n */\nexport declare class TopologyClosedEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/**\n * Representation of a deployment of servers\n * @public\n */\nexport declare class TopologyDescription {\n type: TopologyType;\n setName: string | null;\n maxSetVersion: number | null;\n maxElectionId: ObjectId | null;\n servers: Map<string, ServerDescription>;\n stale: boolean;\n compatible: boolean;\n compatibilityError?: string;\n logicalSessionTimeoutMinutes: number | null;\n heartbeatFrequencyMS: number;\n localThresholdMS: number;\n commonWireVersion: number;\n /**\n * Create a TopologyDescription\n */\n constructor(topologyType: TopologyType, serverDescriptions?: Map<string, ServerDescription> | null, setName?: string | null, maxSetVersion?: number | null, maxElectionId?: ObjectId | null, commonWireVersion?: number | null, options?: TopologyDescriptionOptions | null);\n /* Excluded from this release type: updateFromSrvPollingEvent */\n /* Excluded from this release type: update */\n get error(): MongoError | null;\n /**\n * Determines if the topology description has any known servers\n */\n get hasKnownServers(): boolean;\n /**\n * Determines if this topology description has a data-bearing server available.\n */\n get hasDataBearingServers(): boolean;\n /* Excluded from this release type: hasServer */\n /**\n * Returns a JSON-serializable representation of the TopologyDescription. This is primarily\n * intended for use with JSON.stringify().\n *\n * This method will not throw.\n */\n toJSON(): Document;\n}\n\n/**\n * Emitted when topology description changes.\n * @public\n * @category Event\n */\nexport declare class TopologyDescriptionChangedEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /** The old topology description */\n previousDescription: TopologyDescription;\n /** The new topology description */\n newDescription: TopologyDescription;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/** @public */\nexport declare interface TopologyDescriptionOptions {\n heartbeatFrequencyMS?: number;\n localThresholdMS?: number;\n}\n\n/** @public */\nexport declare type TopologyEvents = {\n /* Excluded from this release type: connect */\n serverOpening(event: ServerOpeningEvent): void;\n serverClosed(event: ServerClosedEvent): void;\n serverDescriptionChanged(event: ServerDescriptionChangedEvent): void;\n topologyClosed(event: TopologyClosedEvent): void;\n topologyOpening(event: TopologyOpeningEvent): void;\n topologyDescriptionChanged(event: TopologyDescriptionChangedEvent): void;\n error(error: Error): void;\n /* Excluded from this release type: open */\n close(): void;\n timeout(): void;\n} & Omit<ServerEvents, 'connect'> & ConnectionPoolEvents & ConnectionEvents & EventEmitterWithState;\n\n/**\n * Emitted when topology is initialized.\n * @public\n * @category Event\n */\nexport declare class TopologyOpeningEvent {\n /** A unique identifier for the topology */\n topologyId: number;\n /* Excluded from this release type: name */\n /* Excluded from this release type: __constructor */\n}\n\n/* Excluded from this release type: TopologyOptions */\n\n/* Excluded from this release type: TopologyPrivate */\n\n/**\n * An enumeration of topology types we know about\n * @public\n */\nexport declare const TopologyType: Readonly<{\n readonly Single: \"Single\";\n readonly ReplicaSetNoPrimary: \"ReplicaSetNoPrimary\";\n readonly ReplicaSetWithPrimary: \"ReplicaSetWithPrimary\";\n readonly Sharded: \"Sharded\";\n readonly Unknown: \"Unknown\";\n readonly LoadBalanced: \"LoadBalanced\";\n}>;\n\n/** @public */\nexport declare type TopologyType = (typeof TopologyType)[keyof typeof TopologyType];\n\n/** @public */\nexport declare interface TopologyVersion {\n processId: ObjectId;\n counter: Long;\n}\n\n/**\n * @public\n * A class maintaining state related to a server transaction. Internal Only\n */\nexport declare class Transaction {\n /* Excluded from this release type: state */\n options: TransactionOptions;\n /* Excluded from this release type: _pinnedServer */\n /* Excluded from this release type: _recoveryToken */\n /* Excluded from this release type: __constructor */\n /* Excluded from this release type: server */\n get recoveryToken(): Document | undefined;\n get isPinned(): boolean;\n /** @returns Whether the transaction has started */\n get isStarting(): boolean;\n /**\n * @returns Whether this session is presently in a transaction\n */\n get isActive(): boolean;\n get isCommitted(): boolean;\n /* Excluded from this release type: transition */\n /* Excluded from this release type: pinServer */\n /* Excluded from this release type: unpinServer */\n}\n\n/**\n * Configuration options for a transaction.\n * @public\n */\nexport declare interface TransactionOptions extends Omit<CommandOperationOptions, 'timeoutMS'> {\n /** A default read concern for commands in this transaction */\n readConcern?: ReadConcernLike;\n /** A default writeConcern for commands in this transaction */\n writeConcern?: WriteConcern;\n /** A default read preference for commands in this transaction */\n readPreference?: ReadPreferenceLike;\n /** Specifies the maximum amount of time to allow a commit action on a transaction to run in milliseconds */\n maxCommitTimeMS?: number;\n}\n\n/* Excluded from this release type: TxnState */\n\n/**\n * Typescript type safe event emitter\n * @public\n */\nexport declare interface TypedEventEmitter<Events extends EventsDescription> extends EventEmitter {\n addListener<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n addListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n addListener(event: string | symbol, listener: GenericListener): this;\n on<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n on(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n on(event: string | symbol, listener: GenericListener): this;\n once<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n once(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n once(event: string | symbol, listener: GenericListener): this;\n removeListener<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n removeListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n removeListener(event: string | symbol, listener: GenericListener): this;\n off<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n off(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n off(event: string | symbol, listener: GenericListener): this;\n removeAllListeners<EventKey extends keyof Events>(event?: EventKey | CommonEvents | symbol | string): this;\n listeners<EventKey extends keyof Events>(event: EventKey | CommonEvents | symbol | string): Events[EventKey][];\n rawListeners<EventKey extends keyof Events>(event: EventKey | CommonEvents | symbol | string): Events[EventKey][];\n emit<EventKey extends keyof Events>(event: EventKey | symbol, ...args: Parameters<Events[EventKey]>): boolean;\n listenerCount<EventKey extends keyof Events>(type: EventKey | CommonEvents | symbol | string): number;\n prependListener<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n prependListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n prependListener(event: string | symbol, listener: GenericListener): this;\n prependOnceListener<EventKey extends keyof Events>(event: EventKey, listener: Events[EventKey]): this;\n prependOnceListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this;\n prependOnceListener(event: string | symbol, listener: GenericListener): this;\n eventNames(): string[];\n getMaxListeners(): number;\n setMaxListeners(n: number): this;\n}\n\n/**\n * Typescript type safe event emitter\n * @public\n */\nexport declare class TypedEventEmitter<Events extends EventsDescription> extends EventEmitter {\n /* Excluded from this release type: mongoLogger */\n /* Excluded from this release type: component */\n /* Excluded from this release type: emitAndLog */\n /* Excluded from this release type: emitAndLogHeartbeat */\n /* Excluded from this release type: emitAndLogCommand */\n}\n\n/** @public */\nexport declare class UnorderedBulkOperation extends BulkOperationBase {\n /* Excluded from this release type: __constructor */\n handleWriteError(writeResult: BulkWriteResult): void;\n addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this;\n}\n\n/** @public */\nexport declare interface UpdateDescription<TSchema extends Document = Document> {\n /**\n * A document containing key:value pairs of names of the fields that were\n * changed, and the new value for those fields.\n */\n updatedFields?: Partial<TSchema>;\n /**\n * An array of field names that were removed from the document.\n */\n removedFields?: string[];\n /**\n * An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages:\n * - $addFields\n * - $set\n * - $replaceRoot\n * - $replaceWith\n */\n truncatedArrays?: Array<{\n /** The name of the truncated field. */\n field: string;\n /** The number of elements in the truncated array. */\n newSize: number;\n }>;\n /**\n * A document containing additional information about any ambiguous update paths from the update event. The document\n * maps the full ambiguous update path to an array containing the actual resolved components of the path. For example,\n * given a document shaped like `{ a: { '0': 0 } }`, and an update of `{ $inc: 'a.0' }`, disambiguated paths would look like\n * the following:\n *\n * ```\n * {\n * 'a.0': ['a', '0']\n * }\n * ```\n *\n * This field is only present when there are ambiguous paths that are updated as a part of the update event.\n *\n * On \\<8.2.0 servers, this field is only present when `showExpandedEvents` is set to true.\n * is enabled for the change stream.\n *\n * On 8.2.0+ servers, this field is present for update events regardless of whether `showExpandedEvents` is enabled.\n * @sinceServerVersion 6.1.0\n */\n disambiguatedPaths?: Document;\n}\n\n/** @public */\nexport declare type UpdateFilter<TSchema> = {\n $currentDate?: OnlyFieldsOfType<TSchema, Date | Timestamp, true | {\n $type: 'date' | 'timestamp';\n }>;\n $inc?: OnlyFieldsOfType<TSchema, NumericType | undefined>;\n $min?: MatchKeysAndValues<TSchema>;\n $max?: MatchKeysAndValues<TSchema>;\n $mul?: OnlyFieldsOfType<TSchema, NumericType | undefined>;\n $rename?: Record<string, string>;\n $set?: MatchKeysAndValues<TSchema>;\n $setOnInsert?: MatchKeysAndValues<TSchema>;\n $unset?: OnlyFieldsOfType<TSchema, any, '' | true | 1>;\n $addToSet?: SetFields<TSchema>;\n $pop?: OnlyFieldsOfType<TSchema, ReadonlyArray<any>, 1 | -1>;\n $pull?: PullOperator<TSchema>;\n $push?: PushOperator<TSchema>;\n $pullAll?: PullAllOperator<TSchema>;\n $bit?: OnlyFieldsOfType<TSchema, NumericType | undefined, {\n and: IntegerType;\n } | {\n or: IntegerType;\n } | {\n xor: IntegerType;\n }>;\n} & Document;\n\n/** @public */\nexport declare interface UpdateManyModel<TSchema extends Document = Document> {\n /** The filter to limit the updated documents. */\n filter: Filter<TSchema>;\n /**\n * The modifications to apply. The value can be either:\n * UpdateFilter<TSchema> - A document that contains update operator expressions,\n * Document[] - an aggregation pipeline.\n */\n update: UpdateFilter<TSchema> | Document[];\n /** A set of filters specifying to which array elements an update should apply. */\n arrayFilters?: Document[];\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/** @public */\nexport declare interface UpdateOneModel<TSchema extends Document = Document> {\n /** The filter to limit the updated documents. */\n filter: Filter<TSchema>;\n /**\n * The modifications to apply. The value can be either:\n * UpdateFilter<TSchema> - A document that contains update operator expressions,\n * Document[] - an aggregation pipeline.\n */\n update: UpdateFilter<TSchema> | Document[];\n /** A set of filters specifying to which array elements an update should apply. */\n arrayFilters?: Document[];\n /** Specifies a collation. */\n collation?: CollationOptions;\n /** The index to use. If specified, then the query system will only consider plans using the hinted index. */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query. */\n upsert?: boolean;\n}\n\n/** @public */\nexport declare interface UpdateOptions extends CommandOperationOptions {\n /** A set of filters specifying to which array elements an update should apply */\n arrayFilters?: Document[];\n /** If true, allows the write to opt-out of document level validation */\n bypassDocumentValidation?: boolean;\n /** Specifies a collation */\n collation?: CollationOptions;\n /** Specify that the update query should only consider plans using the hinted index */\n hint?: Hint;\n /** When true, creates a new document if no document matches the query */\n upsert?: boolean;\n /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */\n let?: Document;\n}\n\n/**\n * @public\n * `TSchema` is the schema of the collection\n */\nexport declare interface UpdateResult<TSchema extends Document = Document> {\n /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */\n acknowledged: boolean;\n /** The number of documents that matched the filter */\n matchedCount: number;\n /** The number of documents that were modified */\n modifiedCount: number;\n /** The number of documents that were upserted */\n upsertedCount: number;\n /** The identifier of the inserted document if an upsert took place */\n upsertedId: InferIdType<TSchema> | null;\n}\n\n/** @public */\nexport declare interface UpdateStatement {\n /** The query that matches documents to update. */\n q: Document;\n /** The modifications to apply. */\n u: Document | Document[];\n /** If true, perform an insert if no documents match the query. */\n upsert?: boolean;\n /** If true, updates all documents that meet the query criteria. */\n multi?: boolean;\n /** Specifies the collation to use for the operation. */\n collation?: CollationOptions;\n /** An array of filter documents that determines which array elements to modify for an update operation on an array field. */\n arrayFilters?: Document[];\n /** A document or string that specifies the index to use to support the query predicate. */\n hint?: Hint;\n}\n\nexport { UUID }\n\n/** @public */\nexport declare interface ValidateCollectionOptions extends CommandOperationOptions {\n /** Validates a collection in the background, without interrupting read or write traffic (only in MongoDB 4.4+) */\n background?: boolean;\n}\n\n/** @public */\nexport declare type W = number | 'majority';\n\n/* Excluded from this release type: WAITING_FOR_SUITABLE_SERVER */\n\n/* Excluded from this release type: WaitingForSuitableServerEvent */\n\n/* Excluded from this release type: WaitQueueMember */\n\n/* Excluded from this release type: WithConnectionCallback */\n\n/** Add an _id field to an object shaped type @public */\nexport declare type WithId<TSchema> = EnhancedOmit<TSchema, '_id'> & {\n _id: InferIdType<TSchema>;\n};\n\n/** Remove the _id field from an object shaped type @public */\nexport declare type WithoutId<TSchema> = Omit<TSchema, '_id'>;\n\n/** @public */\nexport declare type WithSessionCallback<T = unknown> = (session: ClientSession) => Promise<T>;\n\n/** @public */\nexport declare type WithTransactionCallback<T = any> = (session: ClientSession) => Promise<T>;\n\n/* Excluded from this release type: Workflow */\n\n/**\n * A MongoDB WriteConcern, which describes the level of acknowledgement\n * requested from MongoDB for write operations.\n * @public\n *\n * @see https://www.mongodb.com/docs/manual/reference/write-concern/\n */\nexport declare class WriteConcern {\n /**\n * Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.\n * If w is 0 and is set on a write operation, the server will not send a response.\n */\n readonly w?: W;\n /** Request acknowledgment that the write operation has been written to the on-disk journal */\n readonly journal?: boolean;\n /**\n * Specify a time limit to prevent write operations from blocking indefinitely.\n */\n readonly wtimeoutMS?: number;\n /**\n * Specify a time limit to prevent write operations from blocking indefinitely.\n * @deprecated Will be removed in the next major version. Please use wtimeoutMS.\n */\n wtimeout?: number;\n /**\n * Request acknowledgment that the write operation has been written to the on-disk journal.\n * @deprecated Will be removed in the next major version. Please use journal.\n */\n j?: boolean;\n /**\n * Equivalent to the j option.\n * @deprecated Will be removed in the next major version. Please use journal.\n */\n fsync?: boolean | 1;\n /**\n * Constructs a WriteConcern from the write concern properties.\n * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags.\n * @param wtimeoutMS - specify a time limit to prevent write operations from blocking indefinitely\n * @param journal - request acknowledgment that the write operation has been written to the on-disk journal\n * @param fsync - equivalent to the j option. Is deprecated and will be removed in the next major version.\n */\n constructor(w?: W, wtimeoutMS?: number, journal?: boolean, fsync?: boolean | 1);\n /**\n * Apply a write concern to a command document. Will modify and return the command.\n */\n static apply(command: Document, writeConcern: WriteConcern): Document;\n /** Construct a WriteConcern given an options object. */\n static fromOptions(options?: WriteConcernOptions | WriteConcern | W, inherit?: WriteConcernOptions | WriteConcern): WriteConcern | undefined;\n}\n\n/**\n * An error representing a failure by the server to apply the requested write concern to the bulk operation.\n * @public\n * @category Error\n */\nexport declare class WriteConcernError {\n /* Excluded from this release type: serverError */\n constructor(error: WriteConcernErrorData);\n /** Write concern error code. */\n get code(): number | undefined;\n /** Write concern error message. */\n get errmsg(): string | undefined;\n /** Write concern error info. */\n get errInfo(): Document | undefined;\n toJSON(): WriteConcernErrorData;\n toString(): string;\n}\n\n/** @public */\nexport declare interface WriteConcernErrorData {\n code: number;\n errmsg: string;\n errInfo?: Document;\n}\n\n/**\n * The type of the result property of MongoWriteConcernError\n * @public\n */\nexport declare interface WriteConcernErrorResult {\n writeConcernError: {\n code: number;\n errmsg: string;\n codeName?: string;\n errInfo?: Document;\n };\n ok: number;\n code?: number;\n errorLabels?: string[];\n [x: string | number]: unknown;\n}\n\n/** @public */\nexport declare interface WriteConcernOptions {\n /** Write Concern as an object */\n writeConcern?: WriteConcern | WriteConcernSettings;\n}\n\n/** @public */\nexport declare interface WriteConcernSettings {\n /** The write concern */\n w?: W;\n /**\n * The write concern timeout.\n */\n wtimeoutMS?: number;\n /** The journal write concern */\n journal?: boolean;\n /**\n * The journal write concern.\n * @deprecated Will be removed in the next major version. Please use the journal option.\n */\n j?: boolean;\n /**\n * The write concern timeout.\n */\n wtimeout?: number;\n /**\n * The file sync write concern.\n * @deprecated Will be removed in the next major version. Please use the journal option.\n */\n fsync?: boolean | 1;\n}\n\n/**\n * An error that occurred during a BulkWrite on the server.\n * @public\n * @category Error\n */\nexport declare class WriteError {\n err: BulkWriteOperationError;\n constructor(err: BulkWriteOperationError);\n /** WriteError code. */\n get code(): number;\n /** WriteError original bulk operation index. */\n get index(): number;\n /** WriteError message. */\n get errmsg(): string | undefined;\n /** WriteError details. */\n get errInfo(): Document | undefined;\n /** Returns the underlying operation that caused the error */\n getOperation(): Document;\n toJSON(): {\n code: number;\n index: number;\n errmsg?: string;\n op: Document;\n };\n toString(): string;\n}\n\n/* Excluded from this release type: WriteProtocolMessageType */\n\nexport { }\n", "/mql.ts": "/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type * as bson from '/bson.ts';\nimport type { FilterOperators } from '/mongodb.ts';\n\ntype Condition<T> = AlternativeType<T> | FilterOperators<T> | QueryOperator<T>;\ntype AlternativeType<T> =\n T extends ReadonlyArray<infer U> ? T | RegExpOrString<U> : RegExpOrString<T>;\ntype RegExpOrString<T> = T extends string ? Regex | T : T;\ntype KeysOfAType<T, Type> = {\n [k in keyof T]: Extract<T[k], Type> extends never ? never : k;\n}[keyof T];\ntype RecordWithStaticFields<T extends Record<string, any>, TValue> = T & {\n [key: string]: TValue | T[keyof T];\n};\n\n// TBD: Nested fields\ntype AFieldPath<S, Type> = KeysOfAType<S, Type> & string;\ntype FieldExpression<T> = { [k: string]: FieldPath<T> };\n\ntype MultiAnalyzerSpec<T> = {\n value: KeysOfAType<T, string>;\n multi: string;\n};\nexport namespace Aggregation.Accumulator {\n /**\n * A type describing the `$accumulator` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/}\n */\n export interface $accumulator<S> {\n /**\n * Defines a custom accumulator function.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/accumulator/}\n */\n $accumulator: {\n /**\n * Function used to initialize the state. The init function receives its arguments from the initArgs array expression. You can specify the function definition as either BSON type Code or String.\n */\n init: Javascript;\n\n /**\n * Arguments passed to the init function.\n */\n initArgs?: ResolvesToArray<S>;\n\n /**\n * Function used to accumulate documents. The accumulate function receives its arguments from the current state and accumulateArgs array expression. The result of the accumulate function becomes the new state. You can specify the function definition as either BSON type Code or String.\n */\n accumulate: Javascript;\n\n /**\n * Arguments passed to the accumulate function. You can use accumulateArgs to specify what field value(s) to pass to the accumulate function.\n */\n accumulateArgs: ResolvesToArray<S>;\n\n /**\n * Function used to merge two internal states. merge must be either a String or Code BSON type. merge returns the combined result of the two merged states. For information on when the merge function is called, see Merge Two States with $merge.\n */\n merge: Javascript;\n\n /**\n * Function used to update the result of the accumulation.\n */\n finalize?: Javascript;\n\n /**\n * The language used in the $accumulator code.\n */\n lang: string;\n };\n }\n\n /**\n * A type describing the `$addToSet` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/}\n */\n export interface $addToSet<S> {\n /**\n * Returns an array of unique expression values for each group. Order of the array elements is undefined.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addToSet/}\n */\n $addToSet: Expression<S>;\n }\n\n /**\n * A type describing the `$avg` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/}\n */\n export interface $avg<S> {\n /**\n * Returns an average of numerical values. Ignores non-numeric values.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/}\n */\n $avg: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$bottom` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/}\n */\n export interface $bottom<S> {\n /**\n * Returns the bottom element within a group according to the specified sort order.\n * New in MongoDB 5.2: Available in the $group and $setWindowFields stages.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/}\n */\n $bottom: {\n /**\n * Specifies the order of results, with syntax similar to $sort.\n */\n sortBy: SortBy;\n\n /**\n * Represents the output for each element in the group and can be any expression.\n */\n output: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$bottomN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/}\n */\n export interface $bottomN<S> {\n /**\n * Returns an aggregation of the bottom n elements within a group, according to the specified sort order. If the group contains fewer than n elements, $bottomN returns all elements in the group.\n * New in MongoDB 5.2.\n * Available in the $group and $setWindowFields stages.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/}\n */\n $bottomN: {\n /**\n * Limits the number of results per group and has to be a positive integral expression that is either a constant or depends on the _id value for $group.\n */\n n: ResolvesToInt<S>;\n\n /**\n * Specifies the order of results, with syntax similar to $sort.\n */\n sortBy: SortBy;\n\n /**\n * Represents the output for each element in the group and can be any expression.\n */\n output: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$count` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count-accumulator/}\n */\n export interface $count<S> {\n /**\n * Returns the number of documents in the group or window.\n * Distinct from the $count pipeline stage.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count-accumulator/}\n */\n $count: Record<string, never>;\n }\n\n /**\n * A type describing the `$covariancePop` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/}\n */\n export interface $covariancePop<S> {\n /**\n * Returns the population covariance of two numeric expressions.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covariancePop/}\n */\n $covariancePop: [\n expression1: ResolvesToNumber<S>,\n expression2: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$covarianceSamp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/}\n */\n export interface $covarianceSamp<S> {\n /**\n * Returns the sample covariance of two numeric expressions.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/}\n */\n $covarianceSamp: [\n expression1: ResolvesToNumber<S>,\n expression2: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$denseRank` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/}\n */\n export interface $denseRank<S> {\n /**\n * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition. There are no gaps in the ranks. Ties receive the same rank.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/denseRank/}\n */\n $denseRank: Record<string, never>;\n }\n\n /**\n * A type describing the `$derivative` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/derivative/}\n */\n export interface $derivative<S> {\n /**\n * Returns the average rate of change within the specified window.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/derivative/}\n */\n $derivative: {\n input: ResolvesToNumber<S> | ResolvesToDate<S>;\n\n /**\n * A string that specifies the time unit. Use one of these strings: \"week\", \"day\",\"hour\", \"minute\", \"second\", \"millisecond\".\n * If the sortBy field is not a date, you must omit a unit. If you specify a unit, you must specify a date in the sortBy field.\n */\n unit?: TimeUnit;\n };\n }\n\n /**\n * A type describing the `$documentNumber` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documentNumber/}\n */\n export interface $documentNumber<S> {\n /**\n * Returns the position of a document (known as the document number) in the $setWindowFields stage partition. Ties result in different adjacent document numbers.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documentNumber/}\n */\n $documentNumber: Record<string, never>;\n }\n\n /**\n * A type describing the `$expMovingAvg` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/expMovingAvg/}\n */\n export interface $expMovingAvg<S> {\n /**\n * Returns the exponential moving average for the numeric expression.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/expMovingAvg/}\n */\n $expMovingAvg: {\n input: ResolvesToNumber<S>;\n\n /**\n * An integer that specifies the number of historical documents that have a significant mathematical weight in the exponential moving average calculation, with the most recent documents contributing the most weight.\n * You must specify either N or alpha. You cannot specify both.\n * The N value is used in this formula to calculate the current result based on the expression value from the current document being read and the previous result of the calculation:\n */\n N?: Int;\n\n /**\n * A double that specifies the exponential decay value to use in the exponential moving average calculation. A higher alpha value assigns a lower mathematical significance to previous results from the calculation.\n * You must specify either N or alpha. You cannot specify both.\n */\n alpha?: Double;\n };\n }\n\n /**\n * A type describing the `$first` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/}\n */\n export interface $first<S> {\n /**\n * Returns the result of an expression for the first document in a group or window.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/}\n */\n $first: Expression<S>;\n }\n\n /**\n * A type describing the `$firstN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/}\n */\n export interface $firstN<S> {\n /**\n * Returns an aggregation of the first n elements within a group.\n * The elements returned are meaningful only if in a specified sort order.\n * If the group contains fewer than n elements, $firstN returns all elements in the group.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/}\n */\n $firstN: {\n /**\n * An expression that resolves to the array from which to return n elements.\n */\n input: Expression<S>;\n\n /**\n * A positive integral expression that is either a constant or depends on the _id value for $group.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$integral` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/integral/}\n */\n export interface $integral<S> {\n /**\n * Returns the approximation of the area under a curve.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/integral/}\n */\n $integral: {\n input: ResolvesToNumber<S> | ResolvesToDate<S>;\n\n /**\n * A string that specifies the time unit. Use one of these strings: \"week\", \"day\",\"hour\", \"minute\", \"second\", \"millisecond\".\n * If the sortBy field is not a date, you must omit a unit. If you specify a unit, you must specify a date in the sortBy field.\n */\n unit?: TimeUnit;\n };\n }\n\n /**\n * A type describing the `$last` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/}\n */\n export interface $last<S> {\n /**\n * Returns the result of an expression for the last document in a group or window.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/}\n */\n $last: Expression<S>;\n }\n\n /**\n * A type describing the `$lastN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/}\n */\n export interface $lastN<S> {\n /**\n * Returns an aggregation of the last n elements within a group.\n * The elements returned are meaningful only if in a specified sort order.\n * If the group contains fewer than n elements, $lastN returns all elements in the group.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/}\n */\n $lastN: {\n /**\n * An expression that resolves to the array from which to return n elements.\n */\n input: Expression<S>;\n\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$linearFill` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/linearFill/}\n */\n export interface $linearFill<S> {\n /**\n * Fills null and missing fields in a window using linear interpolation based on surrounding field values.\n * Available in the $setWindowFields stage.\n * New in MongoDB 5.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/linearFill/}\n */\n $linearFill: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$locf` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/locf/}\n */\n export interface $locf<S> {\n /**\n * Last observation carried forward. Sets values for null and missing fields in a window to the last non-null value for the field.\n * Available in the $setWindowFields stage.\n * New in MongoDB 5.2.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/locf/}\n */\n $locf: Expression<S>;\n }\n\n /**\n * A type describing the `$max` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/}\n */\n export interface $max<S> {\n /**\n * Returns the maximum value that results from applying an expression to each document.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/}\n */\n $max: Expression<S>;\n }\n\n /**\n * A type describing the `$maxN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/}\n */\n export interface $maxN<S> {\n /**\n * Returns the n largest values in an array. Distinct from the $maxN accumulator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/}\n */\n $maxN: {\n /**\n * An expression that resolves to the array from which to return the maximal n elements.\n */\n input: ResolvesToArray<S>;\n\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$median` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/}\n */\n export interface $median<S> {\n /**\n * Returns an approximation of the median, the 50th percentile, as a scalar value.\n * New in MongoDB 7.0.\n * This operator is available as an accumulator in these stages:\n * $group\n * $setWindowFields\n * It is also available as an aggregation expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/}\n */\n $median: {\n /**\n * $median calculates the 50th percentile value of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $median calculation ignores it.\n */\n input: ResolvesToNumber<S>;\n\n /**\n * The method that mongod uses to calculate the 50th percentile value. The method must be 'approximate'.\n */\n method: AccumulatorPercentile;\n };\n }\n\n /**\n * A type describing the `$mergeObjects` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/}\n */\n export interface $mergeObjects<S> {\n /**\n * Combines multiple documents into a single document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/}\n */\n $mergeObjects: ResolvesToObject<S>;\n }\n\n /**\n * A type describing the `$min` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/}\n */\n export interface $min<S> {\n /**\n * Returns the minimum value that results from applying an expression to each document.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/}\n */\n $min: Expression<S>;\n }\n\n /**\n * A type describing the `$minN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/}\n */\n export interface $minN<S> {\n /**\n * Returns the n smallest values in an array. Distinct from the $minN accumulator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/}\n */\n $minN: {\n /**\n * An expression that resolves to the array from which to return the maximal n elements.\n */\n input: ResolvesToArray<S>;\n\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$percentile` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/}\n */\n export interface $percentile<S> {\n /**\n * Returns an array of scalar values that correspond to specified percentile values.\n * New in MongoDB 7.0.\n * This operator is available as an accumulator in these stages:\n * $group\n * $setWindowFields\n * It is also available as an aggregation expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/}\n */\n $percentile: {\n /**\n * $percentile calculates the percentile values of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $percentile calculation ignores it.\n */\n input: ResolvesToNumber<S>;\n\n /**\n * $percentile calculates a percentile value for each element in p. The elements represent percentages and must evaluate to numeric values in the range 0.0 to 1.0, inclusive.\n * $percentile returns results in the same order as the elements in p.\n */\n p: ResolvesToArray<S>;\n\n /**\n * The method that mongod uses to calculate the percentile value. The method must be 'approximate'.\n */\n method: AccumulatorPercentile;\n };\n }\n\n /**\n * A type describing the `$push` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/}\n */\n export interface $push<S> {\n /**\n * Returns an array of values that result from applying an expression to each document.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/push/}\n */\n $push: Expression<S>;\n }\n\n /**\n * A type describing the `$rank` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/}\n */\n export interface $rank<S> {\n /**\n * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage partition.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rank/}\n */\n $rank: Record<string, never>;\n }\n\n /**\n * A type describing the `$shift` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shift/}\n */\n export interface $shift<S> {\n /**\n * Returns the value from an expression applied to a document in a specified position relative to the current document in the $setWindowFields stage partition.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shift/}\n */\n $shift: {\n /**\n * Specifies an expression to evaluate and return in the output.\n */\n output: Expression<S>;\n\n /**\n * Specifies an integer with a numeric document position relative to the current document in the output.\n * For example:\n * 1 specifies the document position after the current document.\n * -1 specifies the document position before the current document.\n * -2 specifies the document position that is two positions before the current document.\n */\n by: Int;\n\n /**\n * Specifies an optional default expression to evaluate if the document position is outside of the implicit $setWindowFields stage window. The implicit window contains all the documents in the partition.\n * The default expression must evaluate to a constant value.\n * If you do not specify a default expression, $shift returns null for documents whose positions are outside of the implicit $setWindowFields stage window.\n */\n default: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$stdDevPop` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/}\n */\n export interface $stdDevPop<S> {\n /**\n * Calculates the population standard deviation of the input values. Use if the values encompass the entire population of data you want to represent and do not wish to generalize about a larger population. $stdDevPop ignores non-numeric values.\n * If the values represent only a sample of a population of data from which to generalize about the population, use $stdDevSamp instead.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/}\n */\n $stdDevPop: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$stdDevSamp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/}\n */\n export interface $stdDevSamp<S> {\n /**\n * Calculates the sample standard deviation of the input values. Use if the values encompass a sample of a population of data from which to generalize about the population. $stdDevSamp ignores non-numeric values.\n * If the values represent the entire population of data or you do not wish to generalize about a larger population, use $stdDevPop instead.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/}\n */\n $stdDevSamp: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$sum` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/}\n */\n export interface $sum<S> {\n /**\n * Returns a sum of numerical values. Ignores non-numeric values.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/}\n */\n $sum: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$top` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/top/}\n */\n export interface $top<S> {\n /**\n * Returns the top element within a group according to the specified sort order.\n * New in MongoDB 5.2.\n * Available in the $group and $setWindowFields stages.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/top/}\n */\n $top: {\n /**\n * Specifies the order of results, with syntax similar to $sort.\n */\n sortBy: SortBy;\n\n /**\n * Represents the output for each element in the group and can be any expression.\n */\n output: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$topN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/topN/}\n */\n export interface $topN<S> {\n /**\n * Returns an aggregation of the top n fields within a group, according to the specified sort order.\n * New in MongoDB 5.2.\n * Available in the $group and $setWindowFields stages.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/topN/}\n */\n $topN: {\n /**\n * limits the number of results per group and has to be a positive integral expression that is either a constant or depends on the _id value for $group.\n */\n n: ResolvesToInt<S>;\n\n /**\n * Specifies the order of results, with syntax similar to $sort.\n */\n sortBy: SortBy;\n\n /**\n * Represents the output for each element in the group and can be any expression.\n */\n output: Expression<S>;\n };\n }\n}\nexport namespace Aggregation.Expression {\n /**\n * A type describing the `$abs` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/abs/}\n */\n export interface $abs<S> {\n /**\n * Returns the absolute value of a number.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/abs/}\n */\n $abs: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$acos` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/}\n */\n export interface $acos<S> {\n /**\n * Returns the inverse cosine (arc cosine) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/}\n */\n $acos: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$acosh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/}\n */\n export interface $acosh<S> {\n /**\n * Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/acosh/}\n */\n $acosh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$add` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/}\n */\n export interface $add<S> {\n /**\n * Adds numbers to return the sum, or adds numbers and a date to return a new date. If adding numbers and a date, treats the numbers as milliseconds. Accepts any number of argument expressions, but at most, one expression can resolve to a date.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/add/}\n */\n $add: [\n /**\n * The arguments can be any valid expression as long as they resolve to either all numbers or to numbers and a date.\n */\n ...(ResolvesToNumber<S> | ResolvesToDate<S>)[],\n ];\n }\n\n /**\n * A type describing the `$allElementsTrue` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/allElementsTrue/}\n */\n export interface $allElementsTrue<S> {\n /**\n * Returns true if no element of a set evaluates to false, otherwise, returns false. Accepts a single argument expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/allElementsTrue/}\n */\n $allElementsTrue: [expression: ResolvesToArray<S>];\n }\n\n /**\n * A type describing the `$and` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/and/}\n */\n export interface $and<S> {\n /**\n * Returns true only when all its expressions evaluate to true. Accepts any number of argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/and/}\n */\n $and: [\n ...(\n | Expression<S>\n | ResolvesToBool<S>\n | ResolvesToNumber<S>\n | ResolvesToString<S>\n | ResolvesToNull<S>\n )[],\n ];\n }\n\n /**\n * A type describing the `$anyElementTrue` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/anyElementTrue/}\n */\n export interface $anyElementTrue<S> {\n /**\n * Returns true if any elements of a set evaluate to true; otherwise, returns false. Accepts a single argument expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/anyElementTrue/}\n */\n $anyElementTrue: [expression: ResolvesToArray<S>];\n }\n\n /**\n * A type describing the `$arrayElemAt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayElemAt/}\n */\n export interface $arrayElemAt<S> {\n /**\n * Returns the element at the specified array index.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayElemAt/}\n */\n $arrayElemAt: [array: ResolvesToArray<S>, idx: ResolvesToInt<S>];\n }\n\n /**\n * A type describing the `$arrayToObject` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/}\n */\n export interface $arrayToObject<S> {\n /**\n * Converts an array of key value pairs to a document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/arrayToObject/}\n */\n $arrayToObject: [array: ResolvesToArray<S>];\n }\n\n /**\n * A type describing the `$asin` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/}\n */\n export interface $asin<S> {\n /**\n * Returns the inverse sin (arc sine) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asin/}\n */\n $asin: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$asinh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/}\n */\n export interface $asinh<S> {\n /**\n * Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/asinh/}\n */\n $asinh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$atan` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/}\n */\n export interface $atan<S> {\n /**\n * Returns the inverse tangent (arc tangent) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan/}\n */\n $atan: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$atan2` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2/}\n */\n export interface $atan2<S> {\n /**\n * Returns the inverse tangent (arc tangent) of y / x in radians, where y and x are the first and second values passed to the expression respectively.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atan2/}\n */\n $atan2: [\n /**\n * $atan2 takes any valid expression that resolves to a number.\n * $atan2 returns values in radians. Use $radiansToDegrees operator to convert the output value from radians to degrees.\n * By default $atan returns values as a double. $atan2 can also return values as a 128-bit decimal as long as the expression resolves to a 128-bit decimal value.\n */\n y: ResolvesToNumber<S>,\n x: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$atanh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/}\n */\n export interface $atanh<S> {\n /**\n * Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/atanh/}\n */\n $atanh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$avg` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/}\n */\n export interface $avg<S> {\n /**\n * Returns an average of numerical values. Ignores non-numeric values.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/avg/}\n */\n $avg: [...ResolvesToNumber<S>[]];\n }\n\n /**\n * A type describing the `$binarySize` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/binarySize/}\n */\n export interface $binarySize<S> {\n /**\n * Returns the size of a given string or binary data value's content in bytes.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/binarySize/}\n */\n $binarySize: ResolvesToString<S> | ResolvesToBinData<S> | ResolvesToNull<S>;\n }\n\n /**\n * A type describing the `$bitAnd` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitAnd/}\n */\n export interface $bitAnd<S> {\n /**\n * Returns the result of a bitwise and operation on an array of int or long values.\n * New in MongoDB 6.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitAnd/}\n */\n $bitAnd: [...(ResolvesToInt<S> | ResolvesToLong<S>)[]];\n }\n\n /**\n * A type describing the `$bitNot` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitNot/}\n */\n export interface $bitNot<S> {\n /**\n * Returns the result of a bitwise not operation on a single argument or an array that contains a single int or long value.\n * New in MongoDB 6.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitNot/}\n */\n $bitNot: ResolvesToInt<S> | ResolvesToLong<S>;\n }\n\n /**\n * A type describing the `$bitOr` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitOr/}\n */\n export interface $bitOr<S> {\n /**\n * Returns the result of a bitwise or operation on an array of int or long values.\n * New in MongoDB 6.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitOr/}\n */\n $bitOr: [...(ResolvesToInt<S> | ResolvesToLong<S>)[]];\n }\n\n /**\n * A type describing the `$bitXor` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitXor/}\n */\n export interface $bitXor<S> {\n /**\n * Returns the result of a bitwise xor (exclusive or) operation on an array of int and long values.\n * New in MongoDB 6.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bitXor/}\n */\n $bitXor: [...(ResolvesToInt<S> | ResolvesToLong<S>)[]];\n }\n\n /**\n * A type describing the `$bsonSize` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bsonSize/}\n */\n export interface $bsonSize<S> {\n /**\n * Returns the size in bytes of a given document (i.e. BSON type Object) when encoded as BSON.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bsonSize/}\n */\n $bsonSize: ResolvesToObject<S> | ResolvesToNull<S>;\n }\n\n /**\n * A type describing the `$case` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/}\n */\n export interface $case<S> {\n /**\n * Represents a single case in a $switch expression\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/}\n */\n $case: {\n /**\n * Can be any valid expression that resolves to a boolean. If the result is not a boolean, it is coerced to a boolean value. More information about how MongoDB evaluates expressions as either true or false can be found here.\n */\n case: ResolvesToBool<S>;\n\n /**\n * Can be any valid expression.\n */\n then: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$ceil` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ceil/}\n */\n export interface $ceil<S> {\n /**\n * Returns the smallest integer greater than or equal to the specified number.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ceil/}\n */\n $ceil: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$cmp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cmp/}\n */\n export interface $cmp<S> {\n /**\n * Returns 0 if the two values are equivalent, 1 if the first value is greater than the second, and -1 if the first value is less than the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cmp/}\n */\n $cmp: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$concat` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/}\n */\n export interface $concat<S> {\n /**\n * Concatenates any number of strings.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concat/}\n */\n $concat: [...ResolvesToString<S>[]];\n }\n\n /**\n * A type describing the `$concatArrays` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concatArrays/}\n */\n export interface $concatArrays<S> {\n /**\n * Concatenates arrays to return the concatenated array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/concatArrays/}\n */\n $concatArrays: [...ResolvesToArray<S>[]];\n }\n\n /**\n * A type describing the `$cond` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/}\n */\n export interface $cond<S> {\n /**\n * A ternary operator that evaluates one expression, and depending on the result, returns the value of one of the other two expressions. Accepts either three expressions in an ordered list or three named parameters.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cond/}\n */\n $cond: { if: ResolvesToBool<S>; then: Expression<S>; else: Expression<S> };\n }\n\n /**\n * A type describing the `$convert` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/convert/}\n */\n export interface $convert<S> {\n /**\n * Converts a value to a specified type.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/convert/}\n */\n $convert: {\n input: Expression<S>;\n to: ResolvesToString<S> | ResolvesToInt<S>;\n\n /**\n * The value to return on encountering an error during conversion, including unsupported type conversions. The arguments can be any valid expression.\n * If unspecified, the operation throws an error upon encountering an error and stops.\n */\n onError?: Expression<S>;\n\n /**\n * The value to return if the input is null or missing. The arguments can be any valid expression.\n * If unspecified, $convert returns null if the input is null or missing.\n */\n onNull?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$cos` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/}\n */\n export interface $cos<S> {\n /**\n * Returns the cosine of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cos/}\n */\n $cos: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$cosh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/}\n */\n export interface $cosh<S> {\n /**\n * Returns the hyperbolic cosine of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/cosh/}\n */\n $cosh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$dateAdd` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/}\n */\n export interface $dateAdd<S> {\n /**\n * Adds a number of time units to a date object.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateAdd/}\n */\n $dateAdd: {\n /**\n * The beginning date, in UTC, for the addition operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n startDate:\n | ResolvesToDate<S>\n | ResolvesToTimestamp<S>\n | ResolvesToObjectId<S>;\n\n /**\n * The unit used to measure the amount of time added to the startDate.\n */\n unit: TimeUnit;\n amount: ResolvesToInt<S> | ResolvesToLong<S>;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dateDiff` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateDiff/}\n */\n export interface $dateDiff<S> {\n /**\n * Returns the difference between two dates.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateDiff/}\n */\n $dateDiff: {\n /**\n * The start of the time period. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n startDate:\n | ResolvesToDate<S>\n | ResolvesToTimestamp<S>\n | ResolvesToObjectId<S>;\n\n /**\n * The end of the time period. The endDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n endDate:\n | ResolvesToDate<S>\n | ResolvesToTimestamp<S>\n | ResolvesToObjectId<S>;\n\n /**\n * The time measurement unit between the startDate and endDate\n */\n unit: TimeUnit;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n\n /**\n * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string\n */\n startOfWeek?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dateFromParts` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/}\n */\n export interface $dateFromParts<S> {\n /**\n * Constructs a BSON Date object given the date's constituent parts.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromParts/}\n */\n $dateFromParts: {\n /**\n * Calendar year. Can be any expression that evaluates to a number.\n */\n year?: ResolvesToNumber<S>;\n\n /**\n * ISO Week Date Year. Can be any expression that evaluates to a number.\n */\n isoWeekYear?: ResolvesToNumber<S>;\n\n /**\n * Month. Defaults to 1.\n */\n month?: ResolvesToNumber<S>;\n\n /**\n * Week of year. Defaults to 1.\n */\n isoWeek?: ResolvesToNumber<S>;\n\n /**\n * Day of month. Defaults to 1.\n */\n day?: ResolvesToNumber<S>;\n\n /**\n * Day of week (Monday 1 - Sunday 7). Defaults to 1.\n */\n isoDayOfWeek?: ResolvesToNumber<S>;\n\n /**\n * Hour. Defaults to 0.\n */\n hour?: ResolvesToNumber<S>;\n\n /**\n * Minute. Defaults to 0.\n */\n minute?: ResolvesToNumber<S>;\n\n /**\n * Second. Defaults to 0.\n */\n second?: ResolvesToNumber<S>;\n\n /**\n * Millisecond. Defaults to 0.\n */\n millisecond?: ResolvesToNumber<S>;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dateFromString` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/}\n */\n export interface $dateFromString<S> {\n /**\n * Converts a date/time string to a date object.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateFromString/}\n */\n $dateFromString: {\n /**\n * The date/time string to convert to a date object.\n */\n dateString: ResolvesToString<S>;\n\n /**\n * The date format specification of the dateString. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers.\n * If unspecified, $dateFromString uses \"%Y-%m-%dT%H:%M:%S.%LZ\" as the default format but accepts a variety of formats and attempts to parse the dateString if possible.\n */\n format?: ResolvesToString<S>;\n\n /**\n * The time zone to use to format the date.\n */\n timezone?: ResolvesToString<S>;\n\n /**\n * If $dateFromString encounters an error while parsing the given dateString, it outputs the result value of the provided onError expression. This result value can be of any type.\n * If you do not specify onError, $dateFromString throws an error if it cannot parse dateString.\n */\n onError?: Expression<S>;\n\n /**\n * If the dateString provided to $dateFromString is null or missing, it outputs the result value of the provided onNull expression. This result value can be of any type.\n * If you do not specify onNull and dateString is null or missing, then $dateFromString outputs null.\n */\n onNull?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$dateSubtract` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateSubtract/}\n */\n export interface $dateSubtract<S> {\n /**\n * Subtracts a number of time units from a date object.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateSubtract/}\n */\n $dateSubtract: {\n /**\n * The beginning date, in UTC, for the addition operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n startDate:\n | ResolvesToDate<S>\n | ResolvesToTimestamp<S>\n | ResolvesToObjectId<S>;\n\n /**\n * The unit used to measure the amount of time added to the startDate.\n */\n unit: TimeUnit;\n amount: ResolvesToInt<S> | ResolvesToLong<S>;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dateToParts` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToParts/}\n */\n export interface $dateToParts<S> {\n /**\n * Returns a document containing the constituent parts of a date.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToParts/}\n */\n $dateToParts: {\n /**\n * The input date for which to return parts. date can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n\n /**\n * If set to true, modifies the output document to use ISO week date fields. Defaults to false.\n */\n iso8601?: boolean;\n };\n }\n\n /**\n * A type describing the `$dateToString` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/}\n */\n export interface $dateToString<S> {\n /**\n * Returns the date as a formatted string.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/}\n */\n $dateToString: {\n /**\n * The date to convert to string. Must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The date format specification of the dateString. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers.\n * If unspecified, $dateFromString uses \"%Y-%m-%dT%H:%M:%S.%LZ\" as the default format but accepts a variety of formats and attempts to parse the dateString if possible.\n */\n format?: ResolvesToString<S>;\n\n /**\n * The time zone to use to format the date.\n */\n timezone?: ResolvesToString<S>;\n\n /**\n * The value to return if the date is null or missing.\n * If unspecified, $dateToString returns null if the date is null or missing.\n */\n onNull?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$dateTrunc` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateTrunc/}\n */\n export interface $dateTrunc<S> {\n /**\n * Truncates a date.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateTrunc/}\n */\n $dateTrunc: {\n /**\n * The date to truncate, specified in UTC. The date can be any expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The unit of time, specified as an expression that must resolve to one of these strings: year, quarter, week, month, day, hour, minute, second.\n * Together, binSize and unit specify the time period used in the $dateTrunc calculation.\n */\n unit: TimeUnit;\n\n /**\n * The numeric time value, specified as an expression that must resolve to a positive non-zero number. Defaults to 1.\n * Together, binSize and unit specify the time period used in the $dateTrunc calculation.\n */\n binSize?: ResolvesToNumber<S>;\n\n /**\n * The timezone to carry out the operation. $timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n\n /**\n * The start of the week. Used when\n * unit is week. Defaults to Sunday.\n */\n startOfWeek?: string;\n };\n }\n\n /**\n * A type describing the `$dayOfMonth` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfMonth/}\n */\n export interface $dayOfMonth<S> {\n /**\n * Returns the day of the month for a date as a number between 1 and 31.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfMonth/}\n */\n $dayOfMonth: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dayOfWeek` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfWeek/}\n */\n export interface $dayOfWeek<S> {\n /**\n * Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfWeek/}\n */\n $dayOfWeek: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$dayOfYear` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfYear/}\n */\n export interface $dayOfYear<S> {\n /**\n * Returns the day of the year for a date as a number between 1 and 366 (leap year).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/dayOfYear/}\n */\n $dayOfYear: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$degreesToRadians` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/degreesToRadians/}\n */\n export interface $degreesToRadians<S> {\n /**\n * Converts a value from degrees to radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/degreesToRadians/}\n */\n $degreesToRadians: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$divide` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/divide/}\n */\n export interface $divide<S> {\n /**\n * Returns the result of dividing the first number by the second. Accepts two argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/divide/}\n */\n $divide: [\n /**\n * The first argument is the dividend, and the second argument is the divisor; i.e. the first argument is divided by the second argument.\n */\n dividend: ResolvesToNumber<S>,\n divisor: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$eq` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/eq/}\n */\n export interface $eq<S> {\n /**\n * Returns true if the values are equivalent.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/eq/}\n */\n $eq: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$exp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/exp/}\n */\n export interface $exp<S> {\n /**\n * Raises e to the specified exponent.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/exp/}\n */\n $exp: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$filter` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/}\n */\n export interface $filter<S> {\n /**\n * Selects a subset of the array to return an array with only the elements that match the filter condition.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/filter/}\n */\n $filter: {\n input: ResolvesToArray<S>;\n\n /**\n * An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as.\n */\n cond: ResolvesToBool<S>;\n\n /**\n * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this.\n */\n as?: string;\n\n /**\n * A number expression that restricts the number of matching array elements that $filter returns. You cannot specify a limit less than 1. The matching array elements are returned in the order they appear in the input array.\n * If the specified limit is greater than the number of matching array elements, $filter returns all matching array elements. If the limit is null, $filter returns all matching array elements.\n */\n limit?: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$first` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/}\n */\n export interface $first<S> {\n /**\n * Returns the result of an expression for the first document in an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/first/}\n */\n $first: ResolvesToArray<S>;\n }\n\n /**\n * A type describing the `$firstN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN-array-element/}\n */\n export interface $firstN<S> {\n /**\n * Returns a specified number of elements from the beginning of an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN-array-element/}\n */\n $firstN: {\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns.\n */\n n: ResolvesToInt<S>;\n\n /**\n * An expression that resolves to the array from which to return n elements.\n */\n input: ResolvesToArray<S>;\n };\n }\n\n /**\n * A type describing the `$floor` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/floor/}\n */\n export interface $floor<S> {\n /**\n * Returns the largest integer less than or equal to the specified number.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/floor/}\n */\n $floor: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$function` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/}\n */\n export interface $function<S> {\n /**\n * Defines a custom function.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/function/}\n */\n $function: {\n /**\n * The function definition. You can specify the function definition as either BSON\\JavaScript or string.\n * function(arg1, arg2, ...) { ... }\n */\n body: Javascript;\n\n /**\n * Arguments passed to the function body. If the body function does not take an argument, you can specify an empty array [ ].\n */\n args: unknown[];\n lang: string;\n };\n }\n\n /**\n * A type describing the `$getField` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/}\n */\n export interface $getField<S> {\n /**\n * Returns the value of a specified field from a document. You can use $getField to retrieve the value of fields with names that contain periods (.) or start with dollar signs ($).\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/}\n */\n $getField: {\n /**\n * Field in the input object for which you want to return a value. field can be any valid expression that resolves to a string constant.\n * If field begins with a dollar sign ($), place the field name inside of a $literal expression to return its value.\n */\n field: ResolvesToString<S>;\n\n /**\n * Default: $$CURRENT\n * A valid expression that contains the field for which you want to return a value. input must resolve to an object, missing, null, or undefined. If omitted, defaults to the document currently being processed in the pipeline ($$CURRENT).\n */\n input?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$gt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gt/}\n */\n export interface $gt<S> {\n /**\n * Returns true if the first value is greater than the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gt/}\n */\n $gt: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$gte` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gte/}\n */\n export interface $gte<S> {\n /**\n * Returns true if the first value is greater than or equal to the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/gte/}\n */\n $gte: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$hour` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/hour/}\n */\n export interface $hour<S> {\n /**\n * Returns the hour for a date as a number between 0 and 23.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/hour/}\n */\n $hour: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$ifNull` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/}\n */\n export interface $ifNull<S> {\n /**\n * Returns either the non-null result of the first expression or the result of the second expression if the first expression results in a null result. Null result encompasses instances of undefined values or missing fields. Accepts two expressions as arguments. The result of the second expression can be null.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/}\n */\n $ifNull: [...Expression<S>[]];\n }\n\n /**\n * A type describing the `$in` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/in/}\n */\n export interface $in<S> {\n /**\n * Returns a boolean indicating whether a specified value is in an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/in/}\n */\n $in: [\n /**\n * Any valid expression expression.\n */\n expression: Expression<S>,\n\n /**\n * Any valid expression that resolves to an array.\n */\n array: ResolvesToArray<S>,\n ];\n }\n\n /**\n * A type describing the `$indexOfArray` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfArray/}\n */\n export interface $indexOfArray<S> {\n /**\n * Searches an array for an occurrence of a specified value and returns the array index of the first occurrence. Array indexes start at zero.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfArray/}\n */\n $indexOfArray: [\n /**\n * Can be any valid expression as long as it resolves to an array.\n * If the array expression resolves to a value of null or refers to a field that is missing, $indexOfArray returns null.\n * If the array expression does not resolve to an array or null nor refers to a missing field, $indexOfArray returns an error.\n */\n array: ResolvesToArray<S>,\n search: Expression<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number.\n * If unspecified, the starting index position for the search is the beginning of the string.\n */\n start?: ResolvesToInt<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a <end> index value, you should also specify a <start> index value; otherwise, $indexOfArray uses the <end> value as the <start> index value instead of the <end> value.\n * If unspecified, the ending index position for the search is the end of the string.\n */\n end?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$indexOfBytes` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfBytes/}\n */\n export interface $indexOfBytes<S> {\n /**\n * Searches a string for an occurrence of a substring and returns the UTF-8 byte index of the first occurrence. If the substring is not found, returns -1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfBytes/}\n */\n $indexOfBytes: [\n /**\n * Can be any valid expression as long as it resolves to a string.\n * If the string expression resolves to a value of null or refers to a field that is missing, $indexOfBytes returns null.\n * If the string expression does not resolve to a string or null nor refers to a missing field, $indexOfBytes returns an error.\n */\n string: ResolvesToString<S>,\n\n /**\n * Can be any valid expression as long as it resolves to a string.\n */\n substring: ResolvesToString<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number.\n * If unspecified, the starting index position for the search is the beginning of the string.\n */\n start?: ResolvesToInt<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a <end> index value, you should also specify a <start> index value; otherwise, $indexOfArray uses the <end> value as the <start> index value instead of the <end> value.\n * If unspecified, the ending index position for the search is the end of the string.\n */\n end?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$indexOfCP` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfCP/}\n */\n export interface $indexOfCP<S> {\n /**\n * Searches a string for an occurrence of a substring and returns the UTF-8 code point index of the first occurrence. If the substring is not found, returns -1\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexOfCP/}\n */\n $indexOfCP: [\n /**\n * Can be any valid expression as long as it resolves to a string.\n * If the string expression resolves to a value of null or refers to a field that is missing, $indexOfCP returns null.\n * If the string expression does not resolve to a string or null nor refers to a missing field, $indexOfCP returns an error.\n */\n string: ResolvesToString<S>,\n\n /**\n * Can be any valid expression as long as it resolves to a string.\n */\n substring: ResolvesToString<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the starting index position for the search. Can be any valid expression that resolves to a non-negative integral number.\n * If unspecified, the starting index position for the search is the beginning of the string.\n */\n start?: ResolvesToInt<S>,\n\n /**\n * An integer, or a number that can be represented as integers (such as 2.0), that specifies the ending index position for the search. Can be any valid expression that resolves to a non-negative integral number. If you specify a <end> index value, you should also specify a <start> index value; otherwise, $indexOfArray uses the <end> value as the <start> index value instead of the <end> value.\n * If unspecified, the ending index position for the search is the end of the string.\n */\n end?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$isArray` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isArray/}\n */\n export interface $isArray<S> {\n /**\n * Determines if the operand is an array. Returns a boolean.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isArray/}\n */\n $isArray: [expression: Expression<S>];\n }\n\n /**\n * A type describing the `$isNumber` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isNumber/}\n */\n export interface $isNumber<S> {\n /**\n * Returns boolean true if the specified expression resolves to an integer, decimal, double, or long.\n * Returns boolean false if the expression resolves to any other BSON type, null, or a missing field.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isNumber/}\n */\n $isNumber: Expression<S>;\n }\n\n /**\n * A type describing the `$isoDayOfWeek` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoDayOfWeek/}\n */\n export interface $isoDayOfWeek<S> {\n /**\n * Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoDayOfWeek/}\n */\n $isoDayOfWeek: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$isoWeek` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeek/}\n */\n export interface $isoWeek<S> {\n /**\n * Returns the week number in ISO 8601 format, ranging from 1 to 53. Week numbers start at 1 with the week (Monday through Sunday) that contains the year's first Thursday.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeek/}\n */\n $isoWeek: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$isoWeekYear` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/}\n */\n export interface $isoWeekYear<S> {\n /**\n * Returns the year number in ISO 8601 format. The year starts with the Monday of week 1 (ISO 8601) and ends with the Sunday of the last week (ISO 8601).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/}\n */\n $isoWeekYear: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$last` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/}\n */\n export interface $last<S> {\n /**\n * Returns the result of an expression for the last document in an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/last/}\n */\n $last: ResolvesToArray<S>;\n }\n\n /**\n * A type describing the `$lastN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#array-operator}\n */\n export interface $lastN<S> {\n /**\n * Returns a specified number of elements from the end of an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#array-operator}\n */\n $lastN: {\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $firstN returns.\n */\n n: ResolvesToInt<S>;\n\n /**\n * An expression that resolves to the array from which to return n elements.\n */\n input: ResolvesToArray<S>;\n };\n }\n\n /**\n * A type describing the `$let` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/let/}\n */\n export interface $let<S> {\n /**\n * Defines variables for use within the scope of a subexpression and returns the result of the subexpression. Accepts named parameters.\n * Accepts any number of argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/let/}\n */\n $let: {\n /**\n * Assignment block for the variables accessible in the in expression. To assign a variable, specify a string for the variable name and assign a valid expression for the value.\n * The variable assignments have no meaning outside the in expression, not even within the vars block itself.\n */\n vars: ExpressionMap<S>;\n\n /**\n * The expression to evaluate.\n */\n in: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$literal` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/}\n */\n export interface $literal<S> {\n /**\n * Return a value without parsing. Use for values that the aggregation pipeline may interpret as an expression. For example, use a $literal expression to a string that starts with a dollar sign ($) to avoid parsing as a field path.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/literal/}\n */\n $literal: any;\n }\n\n /**\n * A type describing the `$ln` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/}\n */\n export interface $ln<S> {\n /**\n * Calculates the natural log of a number.\n * $ln is equivalent to $log: [ <number>, Math.E ] expression, where Math.E is a JavaScript representation for Euler's number e.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/}\n */\n $ln: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$log` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log/}\n */\n export interface $log<S> {\n /**\n * Calculates the log of a number in the specified base.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log/}\n */\n $log: [\n /**\n * Any valid expression as long as it resolves to a non-negative number.\n */\n number: ResolvesToNumber<S>,\n\n /**\n * Any valid expression as long as it resolves to a positive number greater than 1.\n */\n base: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$log10` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log10/}\n */\n export interface $log10<S> {\n /**\n * Calculates the log base 10 of a number.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/log10/}\n */\n $log10: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$lt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lt/}\n */\n export interface $lt<S> {\n /**\n * Returns true if the first value is less than the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lt/}\n */\n $lt: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$lte` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lte/}\n */\n export interface $lte<S> {\n /**\n * Returns true if the first value is less than or equal to the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lte/}\n */\n $lte: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$ltrim` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/}\n */\n export interface $ltrim<S> {\n /**\n * Removes whitespace or the specified characters from the beginning of a string.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ltrim/}\n */\n $ltrim: {\n /**\n * The string to trim. The argument can be any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The character(s) to trim from the beginning of the input.\n * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input.\n * If unspecified, $ltrim removes whitespace characters, including the null character.\n */\n chars?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$map` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/map/}\n */\n export interface $map<S> {\n /**\n * Applies a subexpression to each element of an array and returns the array of resulting values in order. Accepts named parameters.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/map/}\n */\n $map: {\n /**\n * An expression that resolves to an array.\n */\n input: ResolvesToArray<S>;\n\n /**\n * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this.\n */\n as?: ResolvesToString<S>;\n\n /**\n * An expression that is applied to each element of the input array. The expression references each element individually with the variable name specified in as.\n */\n in: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$max` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/}\n */\n export interface $max<S> {\n /**\n * Returns the maximum value that results from applying an expression to each document.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/max/}\n */\n $max: [...Expression<S>[]];\n }\n\n /**\n * A type describing the `$maxN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN-array-element/}\n */\n export interface $maxN<S> {\n /**\n * Returns the n largest values in an array. Distinct from the $maxN accumulator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN-array-element/}\n */\n $maxN: {\n /**\n * An expression that resolves to the array from which to return the maximal n elements.\n */\n input: ResolvesToArray<S>;\n\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$median` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/}\n */\n export interface $median<S> {\n /**\n * Returns an approximation of the median, the 50th percentile, as a scalar value.\n * New in MongoDB 7.0.\n * This operator is available as an accumulator in these stages:\n * $group\n * $setWindowFields\n * It is also available as an aggregation expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/median/}\n */\n $median: {\n /**\n * $median calculates the 50th percentile value of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $median calculation ignores it.\n */\n input: ResolvesToNumber<S> | ResolvesToNumber<S>[];\n\n /**\n * The method that mongod uses to calculate the 50th percentile value. The method must be 'approximate'.\n */\n method: AccumulatorPercentile;\n };\n }\n\n /**\n * A type describing the `$mergeObjects` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/}\n */\n export interface $mergeObjects<S> {\n /**\n * Combines multiple documents into a single document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mergeObjects/}\n */\n $mergeObjects: [\n /**\n * Any valid expression that resolves to a document.\n */\n ...ResolvesToObject<S>[],\n ];\n }\n\n /**\n * A type describing the `$meta` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/}\n */\n export interface $meta<S> {\n /**\n * Access available per-document metadata related to the aggregation operation.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/}\n */\n $meta: string;\n }\n\n /**\n * A type describing the `$millisecond` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/millisecond/}\n */\n export interface $millisecond<S> {\n /**\n * Returns the milliseconds of a date as a number between 0 and 999.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/millisecond/}\n */\n $millisecond: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$min` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/}\n */\n export interface $min<S> {\n /**\n * Returns the minimum value that results from applying an expression to each document.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/min/}\n */\n $min: [...Expression<S>[]];\n }\n\n /**\n * A type describing the `$minN` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN-array-element/}\n */\n export interface $minN<S> {\n /**\n * Returns the n smallest values in an array. Distinct from the $minN accumulator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN-array-element/}\n */\n $minN: {\n /**\n * An expression that resolves to the array from which to return the maximal n elements.\n */\n input: ResolvesToArray<S>;\n\n /**\n * An expression that resolves to a positive integer. The integer specifies the number of array elements that $maxN returns.\n */\n n: ResolvesToInt<S>;\n };\n }\n\n /**\n * A type describing the `$minute` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minute/}\n */\n export interface $minute<S> {\n /**\n * Returns the minute for a date as a number between 0 and 59.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/minute/}\n */\n $minute: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$mod` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mod/}\n */\n export interface $mod<S> {\n /**\n * Returns the remainder of the first number divided by the second. Accepts two argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/mod/}\n */\n $mod: [\n /**\n * The first argument is the dividend, and the second argument is the divisor; i.e. first argument is divided by the second argument.\n */\n dividend: ResolvesToNumber<S>,\n divisor: ResolvesToNumber<S>,\n ];\n }\n\n /**\n * A type describing the `$month` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/}\n */\n export interface $month<S> {\n /**\n * Returns the month for a date as a number between 1 (January) and 12 (December).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/month/}\n */\n $month: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$multiply` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/}\n */\n export interface $multiply<S> {\n /**\n * Multiplies numbers to return the product. Accepts any number of argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/multiply/}\n */\n $multiply: [\n /**\n * The arguments can be any valid expression as long as they resolve to numbers.\n * Starting in MongoDB 6.1 you can optimize the $multiply operation. To improve performance, group references at the end of the argument list.\n */\n ...ResolvesToNumber<S>[],\n ];\n }\n\n /**\n * A type describing the `$ne` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/}\n */\n export interface $ne<S> {\n /**\n * Returns true if the values are not equivalent.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/ne/}\n */\n $ne: [expression1: Expression<S>, expression2: Expression<S>];\n }\n\n /**\n * A type describing the `$not` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/not/}\n */\n export interface $not<S> {\n /**\n * Returns the boolean value that is the opposite of its argument expression. Accepts a single argument expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/not/}\n */\n $not: [expression: Expression<S> | ResolvesToBool<S>];\n }\n\n /**\n * A type describing the `$objectToArray` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/objectToArray/}\n */\n export interface $objectToArray<S> {\n /**\n * Converts a document to an array of documents representing key-value pairs.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/objectToArray/}\n */\n $objectToArray: ResolvesToObject<S>;\n }\n\n /**\n * A type describing the `$or` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/or/}\n */\n export interface $or<S> {\n /**\n * Returns true when any of its expressions evaluates to true. Accepts any number of argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/or/}\n */\n $or: [...(Expression<S> | ResolvesToBool<S>)[]];\n }\n\n /**\n * A type describing the `$percentile` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/}\n */\n export interface $percentile<S> {\n /**\n * Returns an array of scalar values that correspond to specified percentile values.\n * New in MongoDB 7.0.\n * This operator is available as an accumulator in these stages:\n * $group\n * $setWindowFields\n * It is also available as an aggregation expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/percentile/}\n */\n $percentile: {\n /**\n * $percentile calculates the percentile values of this data. input must be a field name or an expression that evaluates to a numeric type. If the expression cannot be converted to a numeric type, the $percentile calculation ignores it.\n */\n input: ResolvesToNumber<S> | ResolvesToNumber<S>[];\n\n /**\n * $percentile calculates a percentile value for each element in p. The elements represent percentages and must evaluate to numeric values in the range 0.0 to 1.0, inclusive.\n * $percentile returns results in the same order as the elements in p.\n */\n p: ResolvesToArray<S>;\n\n /**\n * The method that mongod uses to calculate the percentile value. The method must be 'approximate'.\n */\n method: AccumulatorPercentile;\n };\n }\n\n /**\n * A type describing the `$pow` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/pow/}\n */\n export interface $pow<S> {\n /**\n * Raises a number to the specified exponent.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/pow/}\n */\n $pow: [number: ResolvesToNumber<S>, exponent: ResolvesToNumber<S>];\n }\n\n /**\n * A type describing the `$radiansToDegrees` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/radiansToDegrees/}\n */\n export interface $radiansToDegrees<S> {\n /**\n * Converts a value from radians to degrees.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/radiansToDegrees/}\n */\n $radiansToDegrees: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$rand` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rand/}\n */\n export interface $rand<S> {\n /**\n * Returns a random float between 0 and 1\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rand/}\n */\n $rand: Record<string, never>;\n }\n\n /**\n * A type describing the `$range` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/}\n */\n export interface $range<S> {\n /**\n * Outputs an array containing a sequence of integers according to user-defined inputs.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/range/}\n */\n $range: [\n /**\n * An integer that specifies the start of the sequence. Can be any valid expression that resolves to an integer.\n */\n start: ResolvesToInt<S>,\n\n /**\n * An integer that specifies the exclusive upper limit of the sequence. Can be any valid expression that resolves to an integer.\n */\n end: ResolvesToInt<S>,\n\n /**\n * An integer that specifies the increment value. Can be any valid expression that resolves to a non-zero integer. Defaults to 1.\n */\n step?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$reduce` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reduce/}\n */\n export interface $reduce<S> {\n /**\n * Applies an expression to each element in an array and combines them into a single value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reduce/}\n */\n $reduce: {\n /**\n * Can be any valid expression that resolves to an array.\n * If the argument resolves to a value of null or refers to a missing field, $reduce returns null.\n * If the argument does not resolve to an array or null nor refers to a missing field, $reduce returns an error.\n */\n input: ResolvesToArray<S>;\n\n /**\n * The initial cumulative value set before in is applied to the first element of the input array.\n */\n initialValue: Expression<S>;\n\n /**\n * A valid expression that $reduce applies to each element in the input array in left-to-right order. Wrap the input value with $reverseArray to yield the equivalent of applying the combining expression from right-to-left.\n * During evaluation of the in expression, two variables will be available:\n * - value is the variable that represents the cumulative value of the expression.\n * - this is the variable that refers to the element being processed.\n */\n in:\n | Expression<\n S & {\n /**\n * The variable that represents the cumulative value of the expression.\n */\n $this: any;\n\n /**\n * The variable that refers to the element being processed.\n */\n $value: any;\n }\n >\n | ExpressionMap<\n S & {\n /**\n * The variable that represents the cumulative value of the expression.\n */\n $this: any;\n\n /**\n * The variable that refers to the element being processed.\n */\n $value: any;\n }\n >;\n };\n }\n\n /**\n * A type describing the `$regexFind` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFind/}\n */\n export interface $regexFind<S> {\n /**\n * Applies a regular expression (regex) to a string and returns information on the first matched substring.\n * New in MongoDB 4.2.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFind/}\n */\n $regexFind: {\n /**\n * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern /<pattern>/. When using the regex /<pattern>/, you can also specify the regex options i and m (but not the s or x options)\n */\n regex: ResolvesToString<S> | Regex;\n options?: string;\n };\n }\n\n /**\n * A type describing the `$regexFindAll` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFindAll/}\n */\n export interface $regexFindAll<S> {\n /**\n * Applies a regular expression (regex) to a string and returns information on the all matched substrings.\n * New in MongoDB 4.2.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexFindAll/}\n */\n $regexFindAll: {\n /**\n * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern /<pattern>/. When using the regex /<pattern>/, you can also specify the regex options i and m (but not the s or x options)\n */\n regex: ResolvesToString<S> | Regex;\n options?: string;\n };\n }\n\n /**\n * A type describing the `$regexMatch` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexMatch/}\n */\n export interface $regexMatch<S> {\n /**\n * Applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not.\n * New in MongoDB 4.2.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/regexMatch/}\n */\n $regexMatch: {\n /**\n * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern /<pattern>/. When using the regex /<pattern>/, you can also specify the regex options i and m (but not the s or x options)\n */\n regex: ResolvesToString<S> | Regex;\n options?: string;\n };\n }\n\n /**\n * A type describing the `$replaceAll` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/}\n */\n export interface $replaceAll<S> {\n /**\n * Replaces all instances of a search string in an input string with a replacement string.\n * $replaceAll is both case-sensitive and diacritic-sensitive, and ignores any collation present on a collection.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceAll/}\n */\n $replaceAll: {\n /**\n * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceAll returns null.\n */\n input: ResolvesToString<S> | ResolvesToNull<S>;\n\n /**\n * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceAll returns null.\n */\n find: ResolvesToString<S> | ResolvesToNull<S>;\n\n /**\n * The string to use to replace all matched instances of find in input. Can be any valid expression that resolves to a string or a null.\n */\n replacement: ResolvesToString<S> | ResolvesToNull<S>;\n };\n }\n\n /**\n * A type describing the `$replaceOne` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/}\n */\n export interface $replaceOne<S> {\n /**\n * Replaces the first instance of a matched string in a given input.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceOne/}\n */\n $replaceOne: {\n /**\n * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceAll returns null.\n */\n input: ResolvesToString<S> | ResolvesToNull<S>;\n\n /**\n * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceAll returns null.\n */\n find: ResolvesToString<S> | ResolvesToNull<S>;\n\n /**\n * The string to use to replace all matched instances of find in input. Can be any valid expression that resolves to a string or a null.\n */\n replacement: ResolvesToString<S> | ResolvesToNull<S>;\n };\n }\n\n /**\n * A type describing the `$reverseArray` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reverseArray/}\n */\n export interface $reverseArray<S> {\n /**\n * Returns an array with the elements in reverse order.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/reverseArray/}\n */\n $reverseArray: ResolvesToArray<S>;\n }\n\n /**\n * A type describing the `$round` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/round/}\n */\n export interface $round<S> {\n /**\n * Rounds a number to a whole integer or to a specified decimal place.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/round/}\n */\n $round: [\n /**\n * Can be any valid expression that resolves to a number. Specifically, the expression must resolve to an integer, double, decimal, or long.\n * $round returns an error if the expression resolves to a non-numeric data type.\n */\n number: ResolvesToNumber<S>,\n\n /**\n * Can be any valid expression that resolves to an integer between -20 and 100, exclusive.\n */\n place?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$rtrim` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/}\n */\n export interface $rtrim<S> {\n /**\n * Removes whitespace characters, including null, or the specified characters from the end of a string.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/rtrim/}\n */\n $rtrim: {\n /**\n * The string to trim. The argument can be any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The character(s) to trim from the beginning of the input.\n * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input.\n * If unspecified, $ltrim removes whitespace characters, including the null character.\n */\n chars?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$second` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/}\n */\n export interface $second<S> {\n /**\n * Returns the seconds for a date as a number between 0 and 60 (leap seconds).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/second/}\n */\n $second: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$setDifference` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/}\n */\n export interface $setDifference<S> {\n /**\n * Returns a set with elements that appear in the first set but not in the second set; i.e. performs a relative complement of the second set relative to the first. Accepts exactly two argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/}\n */\n $setDifference: [\n /**\n * The arguments can be any valid expression as long as they each resolve to an array.\n */\n expression1: ResolvesToArray<S>,\n\n /**\n * The arguments can be any valid expression as long as they each resolve to an array.\n */\n expression2: ResolvesToArray<S>,\n ];\n }\n\n /**\n * A type describing the `$setEquals` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setEquals/}\n */\n export interface $setEquals<S> {\n /**\n * Returns true if the input sets have the same distinct elements. Accepts two or more argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setEquals/}\n */\n $setEquals: [...ResolvesToArray<S>[]];\n }\n\n /**\n * A type describing the `$setField` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setField/}\n */\n export interface $setField<S> {\n /**\n * Adds, updates, or removes a specified field in a document. You can use $setField to add, update, or remove fields with names that contain periods (.) or start with dollar signs ($).\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setField/}\n */\n $setField: {\n /**\n * Field in the input object that you want to add, update, or remove. field can be any valid expression that resolves to a string constant.\n */\n field: ResolvesToString<S>;\n\n /**\n * Document that contains the field that you want to add or update. input must resolve to an object, missing, null, or undefined.\n */\n input: ResolvesToObject<S>;\n\n /**\n * The value that you want to assign to field. value can be any valid expression.\n * Set to $$REMOVE to remove field from the input document.\n */\n value: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$setIntersection` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIntersection/}\n */\n export interface $setIntersection<S> {\n /**\n * Returns a set with elements that appear in all of the input sets. Accepts any number of argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIntersection/}\n */\n $setIntersection: [...ResolvesToArray<S>[]];\n }\n\n /**\n * A type describing the `$setIsSubset` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIsSubset/}\n */\n export interface $setIsSubset<S> {\n /**\n * Returns true if all elements of the first set appear in the second set, including when the first set equals the second set; i.e. not a strict subset. Accepts exactly two argument expressions.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setIsSubset/}\n */\n $setIsSubset: [\n expression1: ResolvesToArray<S>,\n expression2: ResolvesToArray<S>,\n ];\n }\n\n /**\n * A type describing the `$setUnion` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setUnion/}\n */\n export interface $setUnion<S> {\n /**\n * Returns a set with elements that appear in any of the input sets.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setUnion/}\n */\n $setUnion: [...ResolvesToArray<S>[]];\n }\n\n /**\n * A type describing the `$sin` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/}\n */\n export interface $sin<S> {\n /**\n * Returns the sine of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sin/}\n */\n $sin: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$sinh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/}\n */\n export interface $sinh<S> {\n /**\n * Returns the hyperbolic sine of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sinh/}\n */\n $sinh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$size` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/size/}\n */\n export interface $size<S> {\n /**\n * Returns the number of elements in the array. Accepts a single expression as argument.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/size/}\n */\n $size: ResolvesToArray<S>;\n }\n\n /**\n * A type describing the `$slice` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/}\n */\n export interface $slice<S> {\n /**\n * Returns a subset of an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/slice/}\n */\n $slice:\n | [\n /**\n * Any valid expression as long as it resolves to an array.\n */\n expression: ResolvesToArray<S>,\n\n /**\n * Any valid expression as long as it resolves to an integer. If position is specified, n must resolve to a positive integer.\n * If positive, $slice returns up to the first n elements in the array. If the position is specified, $slice returns the first n elements starting from the position.\n * If negative, $slice returns up to the last n elements in the array. n cannot resolve to a negative number if <position> is specified.\n */\n n: ResolvesToInt<S>,\n ]\n | [\n /**\n * Any valid expression as long as it resolves to an array.\n */\n expression: ResolvesToArray<S>,\n\n /**\n * Any valid expression as long as it resolves to an integer.\n * If positive, $slice determines the starting position from the start of the array. If position is greater than the number of elements, the $slice returns an empty array.\n * If negative, $slice determines the starting position from the end of the array. If the absolute value of the <position> is greater than the number of elements, the starting position is the start of the array.\n */\n position: ResolvesToInt<S>,\n\n /**\n * Any valid expression as long as it resolves to an integer. If position is specified, n must resolve to a positive integer.\n * If positive, $slice returns up to the first n elements in the array. If the position is specified, $slice returns the first n elements starting from the position.\n * If negative, $slice returns up to the last n elements in the array. n cannot resolve to a negative number if <position> is specified.\n */\n n: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$sortArray` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/}\n */\n export interface $sortArray<S> {\n /**\n * Sorts the elements of an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortArray/}\n */\n $sortArray: {\n /**\n * The array to be sorted.\n * The result is null if the expression: is missing, evaluates to null, or evaluates to undefined\n * If the expression evaluates to any other non-array value, the document returns an error.\n */\n input: ResolvesToArray<S>;\n\n /**\n * The document specifies a sort ordering.\n */\n sortBy: Int | SortSpec | SortBy;\n };\n }\n\n /**\n * A type describing the `$split` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/}\n */\n export interface $split<S> {\n /**\n * Splits a string into substrings based on a delimiter. Returns an array of substrings. If the delimiter is not found within the string, returns an array containing the original string.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/split/}\n */\n $split: [\n /**\n * The string to be split. string expression can be any valid expression as long as it resolves to a string.\n */\n string: ResolvesToString<S>,\n\n /**\n * The delimiter to use when splitting the string expression. delimiter can be any valid expression as long as it resolves to a string.\n */\n delimiter: ResolvesToString<S>,\n ];\n }\n\n /**\n * A type describing the `$sqrt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sqrt/}\n */\n export interface $sqrt<S> {\n /**\n * Calculates the square root.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sqrt/}\n */\n $sqrt: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$stdDevPop` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/}\n */\n export interface $stdDevPop<S> {\n /**\n * Calculates the population standard deviation of the input values. Use if the values encompass the entire population of data you want to represent and do not wish to generalize about a larger population. $stdDevPop ignores non-numeric values.\n * If the values represent only a sample of a population of data from which to generalize about the population, use $stdDevSamp instead.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/}\n */\n $stdDevPop: [...ResolvesToNumber<S>[]];\n }\n\n /**\n * A type describing the `$stdDevSamp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/}\n */\n export interface $stdDevSamp<S> {\n /**\n * Calculates the sample standard deviation of the input values. Use if the values encompass a sample of a population of data from which to generalize about the population. $stdDevSamp ignores non-numeric values.\n * If the values represent the entire population of data or you do not wish to generalize about a larger population, use $stdDevPop instead.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/}\n */\n $stdDevSamp: [...ResolvesToNumber<S>[]];\n }\n\n /**\n * A type describing the `$strLenBytes` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenBytes/}\n */\n export interface $strLenBytes<S> {\n /**\n * Returns the number of UTF-8 encoded bytes in a string.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenBytes/}\n */\n $strLenBytes: ResolvesToString<S>;\n }\n\n /**\n * A type describing the `$strLenCP` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenCP/}\n */\n export interface $strLenCP<S> {\n /**\n * Returns the number of UTF-8 code points in a string.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strLenCP/}\n */\n $strLenCP: ResolvesToString<S>;\n }\n\n /**\n * A type describing the `$strcasecmp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strcasecmp/}\n */\n export interface $strcasecmp<S> {\n /**\n * Performs case-insensitive string comparison and returns: 0 if two strings are equivalent, 1 if the first string is greater than the second, and -1 if the first string is less than the second.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/strcasecmp/}\n */\n $strcasecmp: [\n expression1: ResolvesToString<S>,\n expression2: ResolvesToString<S>,\n ];\n }\n\n /**\n * A type describing the `$substr` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr/}\n */\n export interface $substr<S> {\n /**\n * Deprecated. Use $substrBytes or $substrCP.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substr/}\n */\n $substr: [\n string: ResolvesToString<S>,\n\n /**\n * If start is a negative number, $substr returns an empty string \"\".\n */\n start: ResolvesToInt<S>,\n\n /**\n * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string.\n */\n length: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$substrBytes` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrBytes/}\n */\n export interface $substrBytes<S> {\n /**\n * Returns the substring of a string. Starts with the character at the specified UTF-8 byte index (zero-based) in the string and continues for the specified number of bytes.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrBytes/}\n */\n $substrBytes: [\n string: ResolvesToString<S>,\n\n /**\n * If start is a negative number, $substr returns an empty string \"\".\n */\n start: ResolvesToInt<S>,\n\n /**\n * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string.\n */\n length: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$substrCP` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrCP/}\n */\n export interface $substrCP<S> {\n /**\n * Returns the substring of a string. Starts with the character at the specified UTF-8 code point (CP) index (zero-based) in the string and continues for the number of code points specified.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/substrCP/}\n */\n $substrCP: [\n string: ResolvesToString<S>,\n\n /**\n * If start is a negative number, $substr returns an empty string \"\".\n */\n start: ResolvesToInt<S>,\n\n /**\n * If length is a negative number, $substr returns a substring that starts at the specified index and includes the rest of the string.\n */\n length: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$subtract` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/subtract/}\n */\n export interface $subtract<S> {\n /**\n * Returns the result of subtracting the second value from the first. If the two values are numbers, return the difference. If the two values are dates, return the difference in milliseconds. If the two values are a date and a number in milliseconds, return the resulting date. Accepts two argument expressions. If the two values are a date and a number, specify the date argument first as it is not meaningful to subtract a date from a number.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/subtract/}\n */\n $subtract: [\n expression1: ResolvesToNumber<S> | ResolvesToDate<S>,\n expression2: ResolvesToNumber<S> | ResolvesToDate<S>,\n ];\n }\n\n /**\n * A type describing the `$sum` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/}\n */\n export interface $sum<S> {\n /**\n * Returns a sum of numerical values. Ignores non-numeric values.\n * Changed in MongoDB 5.0: Available in the $setWindowFields stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sum/}\n */\n $sum: [...(ResolvesToNumber<S> | ResolvesToArray<S>)[]];\n }\n\n /**\n * A type describing the `$switch` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/}\n */\n export interface $switch<S> {\n /**\n * Evaluates a series of case expressions. When it finds an expression which evaluates to true, $switch executes a specified expression and breaks out of the control flow.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/switch/}\n */\n $switch: {\n /**\n * An array of control branch documents. Each branch is a document with the following fields:\n * - case Can be any valid expression that resolves to a boolean. If the result is not a boolean, it is coerced to a boolean value. More information about how MongoDB evaluates expressions as either true or false can be found here.\n * - then Can be any valid expression.\n * The branches array must contain at least one branch document.\n */\n branches: unknown[];\n\n /**\n * The path to take if no branch case expression evaluates to true.\n * Although optional, if default is unspecified and no branch case evaluates to true, $switch returns an error.\n */\n default?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$tan` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/}\n */\n export interface $tan<S> {\n /**\n * Returns the tangent of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tan/}\n */\n $tan: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$tanh` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/}\n */\n export interface $tanh<S> {\n /**\n * Returns the hyperbolic tangent of a value that is measured in radians.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tanh/}\n */\n $tanh: ResolvesToNumber<S>;\n }\n\n /**\n * A type describing the `$toBool` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toBool/}\n */\n export interface $toBool<S> {\n /**\n * Converts value to a boolean.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toBool/}\n */\n $toBool: Expression<S>;\n }\n\n /**\n * A type describing the `$toDate` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/}\n */\n export interface $toDate<S> {\n /**\n * Converts value to a Date.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/}\n */\n $toDate: Expression<S>;\n }\n\n /**\n * A type describing the `$toDecimal` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/}\n */\n export interface $toDecimal<S> {\n /**\n * Converts value to a Decimal128.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDecimal/}\n */\n $toDecimal: Expression<S>;\n }\n\n /**\n * A type describing the `$toDouble` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDouble/}\n */\n export interface $toDouble<S> {\n /**\n * Converts value to a double.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDouble/}\n */\n $toDouble: Expression<S>;\n }\n\n /**\n * A type describing the `$toHashedIndexKey` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toHashedIndexKey/}\n */\n export interface $toHashedIndexKey<S> {\n /**\n * Computes and returns the hash value of the input expression using the same hash function that MongoDB uses to create a hashed index. A hash function maps a key or string to a fixed-size numeric value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toHashedIndexKey/}\n */\n $toHashedIndexKey: Expression<S>;\n }\n\n /**\n * A type describing the `$toInt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/}\n */\n export interface $toInt<S> {\n /**\n * Converts value to an integer.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/}\n */\n $toInt: Expression<S>;\n }\n\n /**\n * A type describing the `$toLong` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/}\n */\n export interface $toLong<S> {\n /**\n * Converts value to a long.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/}\n */\n $toLong: Expression<S>;\n }\n\n /**\n * A type describing the `$toLower` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLower/}\n */\n export interface $toLower<S> {\n /**\n * Converts a string to lowercase. Accepts a single argument expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLower/}\n */\n $toLower: ResolvesToString<S>;\n }\n\n /**\n * A type describing the `$toObjectId` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toObjectId/}\n */\n export interface $toObjectId<S> {\n /**\n * Converts value to an ObjectId.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toObjectId/}\n */\n $toObjectId: Expression<S>;\n }\n\n /**\n * A type describing the `$toString` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/}\n */\n export interface $toString<S> {\n /**\n * Converts value to a string.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/}\n */\n $toString: Expression<S>;\n }\n\n /**\n * A type describing the `$toUpper` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUpper/}\n */\n export interface $toUpper<S> {\n /**\n * Converts a string to uppercase. Accepts a single argument expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/toUpper/}\n */\n $toUpper: ResolvesToString<S>;\n }\n\n /**\n * A type describing the `$trim` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/}\n */\n export interface $trim<S> {\n /**\n * Removes whitespace or the specified characters from the beginning and end of a string.\n * New in MongoDB 4.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trim/}\n */\n $trim: {\n /**\n * The string to trim. The argument can be any valid expression that resolves to a string.\n */\n input: ResolvesToString<S>;\n\n /**\n * The character(s) to trim from the beginning of the input.\n * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input.\n * If unspecified, $ltrim removes whitespace characters, including the null character.\n */\n chars?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$trunc` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/}\n */\n export interface $trunc<S> {\n /**\n * Truncates a number to a whole integer or to a specified decimal place.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/}\n */\n $trunc: [\n /**\n * Can be any valid expression that resolves to a number. Specifically, the expression must resolve to an integer, double, decimal, or long.\n * $trunc returns an error if the expression resolves to a non-numeric data type.\n */\n number: ResolvesToNumber<S>,\n\n /**\n * Can be any valid expression that resolves to an integer between -20 and 100, exclusive. e.g. -20 < place < 100. Defaults to 0.\n */\n place?: ResolvesToInt<S>,\n ];\n }\n\n /**\n * A type describing the `$tsIncrement` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsIncrement/}\n */\n export interface $tsIncrement<S> {\n /**\n * Returns the incrementing ordinal from a timestamp as a long.\n * New in MongoDB 5.1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsIncrement/}\n */\n $tsIncrement: ResolvesToTimestamp<S>;\n }\n\n /**\n * A type describing the `$tsSecond` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsSecond/}\n */\n export interface $tsSecond<S> {\n /**\n * Returns the seconds from a timestamp as a long.\n * New in MongoDB 5.1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/tsSecond/}\n */\n $tsSecond: ResolvesToTimestamp<S>;\n }\n\n /**\n * A type describing the `$type` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/type/}\n */\n export interface $type<S> {\n /**\n * Return the BSON data type of the field.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/type/}\n */\n $type: Expression<S>;\n }\n\n /**\n * A type describing the `$unsetField` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/}\n */\n export interface $unsetField<S> {\n /**\n * You can use $unsetField to remove fields with names that contain periods (.) or that start with dollar signs ($).\n * $unsetField is an alias for $setField using $$REMOVE to remove fields.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/}\n */\n $unsetField: {\n /**\n * Field in the input object that you want to add, update, or remove. field can be any valid expression that resolves to a string constant.\n */\n field: ResolvesToString<S>;\n\n /**\n * Document that contains the field that you want to add or update. input must resolve to an object, missing, null, or undefined.\n */\n input: ResolvesToObject<S>;\n };\n }\n\n /**\n * A type describing the `$week` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/week/}\n */\n export interface $week<S> {\n /**\n * Returns the week number for a date as a number between 0 (the partial week that precedes the first Sunday of the year) and 53 (leap year).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/week/}\n */\n $week: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$year` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/year/}\n */\n export interface $year<S> {\n /**\n * Returns the year for a date as a number (e.g. 2014).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/year/}\n */\n $year: {\n /**\n * The date to which the operator is applied. date must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID.\n */\n date: ResolvesToDate<S> | ResolvesToTimestamp<S> | ResolvesToObjectId<S>;\n\n /**\n * The timezone of the operation result. timezone must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC.\n */\n timezone?: ResolvesToString<S>;\n };\n }\n\n /**\n * A type describing the `$zip` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/zip/}\n */\n export interface $zip<S> {\n /**\n * Merge two arrays together.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/zip/}\n */\n $zip: {\n /**\n * An array of expressions that resolve to arrays. The elements of these input arrays combine to form the arrays of the output array.\n * If any of the inputs arrays resolves to a value of null or refers to a missing field, $zip returns null.\n * If any of the inputs arrays does not resolve to an array or null nor refers to a missing field, $zip returns an error.\n */\n inputs: ResolvesToArray<S>;\n\n /**\n * A boolean which specifies whether the length of the longest array determines the number of arrays in the output array.\n * The default value is false: the shortest array length determines the number of arrays in the output array.\n */\n useLongestLength?: boolean;\n\n /**\n * An array of default element values to use if the input arrays have different lengths. You must specify useLongestLength: true along with this field, or else $zip will return an error.\n * If useLongestLength: true but defaults is empty or not specified, $zip uses null as the default value.\n * If specifying a non-empty defaults, you must specify a default for each input array or else $zip will return an error.\n */\n defaults?: unknown[];\n };\n }\n}\nexport namespace Aggregation.Query {\n /**\n * A type describing the `$all` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/all/}\n */\n export interface $all<S> {\n /**\n * Matches arrays that contain all elements specified in the query.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/all/}\n */\n $all: [...FieldQuery<S>[]];\n }\n\n /**\n * A type describing the `$and` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/and/}\n */\n export interface $and<S> {\n /**\n * Joins query clauses with a logical AND returns all documents that match the conditions of both clauses.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/and/}\n */\n $and: [Query<S>, ...Query<S>[]];\n }\n\n /**\n * A type describing the `$bitsAllClear` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/}\n */\n export interface $bitsAllClear<S> {\n /**\n * Matches numeric or binary values in which a set of bit positions all have a value of 0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllClear/}\n */\n $bitsAllClear: (Int | bson.Binary) | (Int | bson.Binary)[];\n }\n\n /**\n * A type describing the `$bitsAllSet` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/}\n */\n export interface $bitsAllSet<S> {\n /**\n * Matches numeric or binary values in which a set of bit positions all have a value of 1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAllSet/}\n */\n $bitsAllSet: (Int | bson.Binary) | (Int | bson.Binary)[];\n }\n\n /**\n * A type describing the `$bitsAnyClear` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/}\n */\n export interface $bitsAnyClear<S> {\n /**\n * Matches numeric or binary values in which any bit from a set of bit positions has a value of 0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnyClear/}\n */\n $bitsAnyClear: (Int | bson.Binary) | (Int | bson.Binary)[];\n }\n\n /**\n * A type describing the `$bitsAnySet` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/}\n */\n export interface $bitsAnySet<S> {\n /**\n * Matches numeric or binary values in which any bit from a set of bit positions has a value of 1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/bitsAnySet/}\n */\n $bitsAnySet: (Int | bson.Binary) | (Int | bson.Binary)[];\n }\n\n /**\n * A type describing the `$box` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/box/}\n */\n export interface $box<S> {\n /**\n * Specifies a rectangular box using legacy coordinate pairs for $geoWithin queries. The 2d index supports $box.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/box/}\n */\n $box: unknown[];\n }\n\n /**\n * A type describing the `$center` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/center/}\n */\n export interface $center<S> {\n /**\n * Specifies a circle using legacy coordinate pairs to $geoWithin queries when using planar geometry. The 2d index supports $center.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/center/}\n */\n $center: unknown[];\n }\n\n /**\n * A type describing the `$centerSphere` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/}\n */\n export interface $centerSphere<S> {\n /**\n * Specifies a circle using either legacy coordinate pairs or GeoJSON format for $geoWithin queries when using spherical geometry. The 2dsphere and 2d indexes support $centerSphere.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/}\n */\n $centerSphere: unknown[];\n }\n\n /**\n * A type describing the `$elemMatch` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/}\n */\n export interface $elemMatch<S> {\n /**\n * The $elemMatch operator matches documents that contain an array field with at least one element that matches all the specified query criteria.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/}\n */\n $elemMatch: Query<S> | FieldQuery<S>;\n }\n\n /**\n * A type describing the `$eq` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/eq/}\n */\n export interface $eq<S> {\n /**\n * Matches values that are equal to a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/eq/}\n */\n $eq: Expression<S>;\n }\n\n /**\n * A type describing the `$exists` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/exists/}\n */\n export interface $exists<S> {\n /**\n * Matches documents that have the specified field.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/exists/}\n */\n $exists: boolean;\n }\n\n /**\n * A type describing the `$expr` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/expr/}\n */\n export interface $expr<S> {\n /**\n * Allows use of aggregation expressions within the query language.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/expr/}\n */\n $expr: Expression<S>;\n }\n\n /**\n * A type describing the `$geoIntersects` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoIntersects/}\n */\n export interface $geoIntersects<S> {\n /**\n * Selects geometries that intersect with a GeoJSON geometry. The 2dsphere index supports $geoIntersects.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoIntersects/}\n */\n $geoIntersects: Geometry<S> & {};\n }\n\n /**\n * A type describing the `$geoWithin` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/}\n */\n export interface $geoWithin<S> {\n /**\n * Selects geometries within a bounding GeoJSON geometry. The 2dsphere and 2d indexes support $geoWithin.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geoWithin/}\n */\n $geoWithin: Geometry<S> & {};\n }\n\n /**\n * A type describing the `$geometry` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geometry/}\n */\n export interface $geometry<S> {\n /**\n * Specifies a geometry in GeoJSON format to geospatial query operators.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/geometry/}\n */\n $geometry: {\n type: string;\n coordinates: unknown[];\n crs?: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$gt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gt/}\n */\n export interface $gt<S> {\n /**\n * Matches values that are greater than a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gt/}\n */\n $gt: any;\n }\n\n /**\n * A type describing the `$gte` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gte/}\n */\n export interface $gte<S> {\n /**\n * Matches values that are greater than or equal to a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/gte/}\n */\n $gte: any;\n }\n\n /**\n * A type describing the `$in` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/in/}\n */\n export interface $in<S> {\n /**\n * Matches any of the values specified in an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/in/}\n */\n $in: unknown[];\n }\n\n /**\n * A type describing the `$jsonSchema` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/jsonSchema/}\n */\n export interface $jsonSchema<S> {\n /**\n * Validate documents against the given JSON Schema.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/jsonSchema/}\n */\n $jsonSchema: Record<string, unknown>;\n }\n\n /**\n * A type describing the `$lt` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lt/}\n */\n export interface $lt<S> {\n /**\n * Matches values that are less than a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lt/}\n */\n $lt: any;\n }\n\n /**\n * A type describing the `$lte` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lte/}\n */\n export interface $lte<S> {\n /**\n * Matches values that are less than or equal to a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/lte/}\n */\n $lte: any;\n }\n\n /**\n * A type describing the `$maxDistance` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/maxDistance/}\n */\n export interface $maxDistance<S> {\n /**\n * Specifies a maximum distance to limit the results of $near and $nearSphere queries. The 2dsphere and 2d indexes support $maxDistance.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/maxDistance/}\n */\n $maxDistance: Number;\n }\n\n /**\n * A type describing the `$minDistance` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/minDistance/}\n */\n export interface $minDistance<S> {\n /**\n * Specifies a minimum distance to limit the results of $near and $nearSphere queries. For use with 2dsphere index only.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/minDistance/}\n */\n $minDistance: Int | Double;\n }\n\n /**\n * A type describing the `$mod` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/mod/}\n */\n export interface $mod<S> {\n /**\n * Performs a modulo operation on the value of a field and selects documents with a specified result.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/mod/}\n */\n $mod: [divisor: Number, remainder: Number];\n }\n\n /**\n * A type describing the `$ne` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/ne/}\n */\n export interface $ne<S> {\n /**\n * Matches all values that are not equal to a specified value.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/ne/}\n */\n $ne: any;\n }\n\n /**\n * A type describing the `$near` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/near/}\n */\n export interface $near<S> {\n /**\n * Returns geospatial objects in proximity to a point. Requires a geospatial index. The 2dsphere and 2d indexes support $near.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/near/}\n */\n $near: Geometry<S> & {\n /**\n * Distance in meters. Limits the results to those documents that are at most the specified distance from the center point.\n */\n $maxDistance?: Number;\n\n /**\n * Distance in meters. Limits the results to those documents that are at least the specified distance from the center point.\n */\n $minDistance?: Number;\n };\n }\n\n /**\n * A type describing the `$nearSphere` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nearSphere/}\n */\n export interface $nearSphere<S> {\n /**\n * Returns geospatial objects in proximity to a point on a sphere. Requires a geospatial index. The 2dsphere and 2d indexes support $nearSphere.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nearSphere/}\n */\n $nearSphere: Geometry<S> & {\n /**\n * Distance in meters.\n */\n $maxDistance?: Number;\n\n /**\n * Distance in meters. Limits the results to those documents that are at least the specified distance from the center point.\n */\n $minDistance?: Number;\n };\n }\n\n /**\n * A type describing the `$nin` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nin/}\n */\n export interface $nin<S> {\n /**\n * Matches none of the values specified in an array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nin/}\n */\n $nin: unknown[];\n }\n\n /**\n * A type describing the `$nor` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nor/}\n */\n export interface $nor<S> {\n /**\n * Joins query clauses with a logical NOR returns all documents that fail to match both clauses.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/nor/}\n */\n $nor: [Query<S>, ...Query<S>[]];\n }\n\n /**\n * A type describing the `$not` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/not/}\n */\n export interface $not<S> {\n /**\n * Inverts the effect of a query expression and returns documents that do not match the query expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/not/}\n */\n $not: FieldQuery<S>;\n }\n\n /**\n * A type describing the `$or` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/or/}\n */\n export interface $or<S> {\n /**\n * Joins query clauses with a logical OR returns all documents that match the conditions of either clause.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/or/}\n */\n $or: [Query<S>, ...Query<S>[]];\n }\n\n /**\n * A type describing the `$polygon` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/polygon/}\n */\n export interface $polygon<S> {\n /**\n * Specifies a polygon to using legacy coordinate pairs for $geoWithin queries. The 2d index supports $center.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/polygon/}\n */\n $polygon: unknown[];\n }\n\n /**\n * A type describing the `$rand` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/rand/}\n */\n export interface $rand<S> {\n /**\n * Generates a random float between 0 and 1.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/rand/}\n */\n $rand: Record<string, never>;\n }\n\n /**\n * A type describing the `$regex` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/regex/}\n */\n export interface $regex<S> {\n /**\n * Selects documents where values match a specified regular expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/regex/}\n */\n $regex: Regex;\n }\n\n /**\n * A type describing the `$sampleRate` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/}\n */\n export interface $sampleRate<S> {\n /**\n * Randomly select documents at a given rate. Although the exact number of documents selected varies on each run, the quantity chosen approximates the sample rate expressed as a percentage of the total number of documents.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sampleRate/}\n */\n $sampleRate: ResolvesToDouble<S>;\n }\n\n /**\n * A type describing the `$size` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/size/}\n */\n export interface $size<S> {\n /**\n * Selects documents if the array field is a specified size.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/size/}\n */\n $size: Int;\n }\n\n /**\n * A type describing the `$text` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/text/}\n */\n export interface $text<S> {\n /**\n * Performs text search.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/text/}\n */\n $text: {\n /**\n * A string of terms that MongoDB parses and uses to query the text index. MongoDB performs a logical OR search of the terms unless specified as a phrase.\n */\n $search: string;\n\n /**\n * The language that determines the list of stop words for the search and the rules for the stemmer and tokenizer. If not specified, the search uses the default language of the index.\n * If you specify a default_language value of none, then the text index parses through each word in the field, including stop words, and ignores suffix stemming.\n */\n $language?: string;\n\n /**\n * A boolean flag to enable or disable case sensitive search. Defaults to false; i.e. the search defers to the case insensitivity of the text index.\n */\n $caseSensitive?: boolean;\n\n /**\n * A boolean flag to enable or disable diacritic sensitive search against version 3 text indexes. Defaults to false; i.e. the search defers to the diacritic insensitivity of the text index.\n * Text searches against earlier versions of the text index are inherently diacritic sensitive and cannot be diacritic insensitive. As such, the $diacriticSensitive option has no effect with earlier versions of the text index.\n */\n $diacriticSensitive?: boolean;\n };\n }\n\n /**\n * A type describing the `$type` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/type/}\n */\n export interface $type<S> {\n /**\n * Selects documents if a field is of the specified type.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/type/}\n */\n $type: [...(Int | string)[]];\n }\n\n /**\n * A type describing the `$where` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/where/}\n */\n export interface $where<S> {\n /**\n * Matches documents that satisfy a JavaScript expression.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/query/where/}\n */\n $where: Javascript;\n }\n}\nexport namespace Aggregation.Search {\n /**\n * A type describing the `autocomplete` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/}\n */\n export interface Autocomplete<S> {\n /**\n * The autocomplete operator performs a search for a word or phrase that\n * contains a sequence of characters from an incomplete input string. The\n * fields that you intend to query with the autocomplete operator must be\n * indexed with the autocomplete data type in the collection's index definition.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/autocomplete/}\n */\n autocomplete: {\n path: SearchPath<S>;\n query: string;\n tokenOrder?: string;\n fuzzy?: Record<string, unknown>;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `compound` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/compound/}\n */\n export interface Compound<S> {\n /**\n * The compound operator combines two or more operators into a single query.\n * Each element of a compound query is called a clause, and each clause\n * consists of one or more sub-queries.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/compound/}\n */\n compound: {\n must?: SearchOperator<S> | SearchOperator<S>[];\n mustNot?: SearchOperator<S> | SearchOperator<S>[];\n should?: SearchOperator<S> | SearchOperator<S>[];\n filter?: SearchOperator<S> | SearchOperator<S>[];\n minimumShouldMatch?: Int;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `embeddedDocument` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/embedded-document/}\n */\n export interface EmbeddedDocument<S> {\n /**\n * The embeddedDocument operator is similar to $elemMatch operator.\n * It constrains multiple query predicates to be satisfied from a single\n * element of an array of embedded documents. embeddedDocument can be used only\n * for queries over fields of the embeddedDocuments\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/embedded-document/}\n */\n embeddedDocument: {\n path: SearchPath<S>;\n operator: SearchOperator<S>;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `equals` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/equals/}\n */\n export interface Equals<S> {\n /**\n * The equals operator checks whether a field matches a value you specify.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/equals/}\n */\n equals: {\n path: SearchPath<S>;\n value:\n | bson.Binary\n | boolean\n | Date\n | bson.ObjectId\n | null\n | Number\n | string;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `exists` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/exists/}\n */\n export interface Exists<S> {\n /**\n * The exists operator tests if a path to a specified indexed field name exists in a document.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/exists/}\n */\n exists: { path: SearchPath<S>; score?: SearchScore };\n }\n\n /**\n * A type describing the `facet` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/facet/}\n */\n export interface Facet<S> {\n /**\n * The facet collector groups results by values or ranges in the specified\n * faceted fields and returns the count for each of those groups.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/facet/}\n */\n facet: { facets: Record<string, unknown>; operator?: SearchOperator<S> };\n }\n\n /**\n * A type describing the `geoShape` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoShape/}\n */\n export interface GeoShape<S> {\n /**\n * The geoShape operator supports querying shapes with a relation to a given\n * geometry if indexShapes is set to true in the index definition.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoShape/}\n */\n geoShape: {\n path: SearchPath<S>;\n relation: string;\n geometry: Geometry<S>;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `geoWithin` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoWithin/}\n */\n export interface GeoWithin<S> {\n /**\n * The geoWithin operator supports querying geographic points within a given\n * geometry. Only points are returned, even if indexShapes value is true in\n * the index definition.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/geoWithin/}\n */\n geoWithin: {\n path: SearchPath<S>;\n box?: Record<string, unknown>;\n circle?: Record<string, unknown>;\n geometry?: Geometry<S>;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `in` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/in/}\n */\n export interface In<S> {\n /**\n * The in operator performs a search for an array of BSON values in a field.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/in/}\n */\n in: { path: SearchPath<S>; value: any | any[]; score?: SearchScore };\n }\n\n /**\n * A type describing the `moreLikeThis` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/moreLikeThis/}\n */\n export interface MoreLikeThis<S> {\n /**\n * The moreLikeThis operator returns documents similar to input documents.\n * The moreLikeThis operator allows you to build features for your applications\n * that display similar or alternative results based on one or more given documents.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/moreLikeThis/}\n */\n moreLikeThis: {\n like: Record<string, unknown> | Record<string, unknown>[];\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `near` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/near/}\n */\n export interface Near<S> {\n /**\n * The near operator supports querying and scoring numeric, date, and GeoJSON point values.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/near/}\n */\n near: {\n path: SearchPath<S>;\n origin: Date | Number | Geometry<S>;\n pivot: Number;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `phrase` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/phrase/}\n */\n export interface Phrase<S> {\n /**\n * The phrase operator performs search for documents containing an ordered sequence of terms using the analyzer specified in the index configuration.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/phrase/}\n */\n phrase: {\n path: SearchPath<S>;\n query: string | string[];\n slop?: Int;\n synonyms?: string;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `queryString` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/queryString/}\n */\n export interface QueryString<S> {\n queryString: { defaultPath: SearchPath<S>; query: string };\n }\n\n /**\n * A type describing the `range` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/range/}\n */\n export interface Range<S> {\n /**\n * The range operator supports querying and scoring numeric, date, and string values.\n * You can use this operator to find results that are within a given numeric, date, objectId, or letter (from the English alphabet) range.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/range/}\n */\n range: {\n path: SearchPath<S>;\n gt?: Date | Number | string | bson.ObjectId;\n gte?: Date | Number | string | bson.ObjectId;\n lt?: Date | Number | string | bson.ObjectId;\n lte?: Date | Number | string | bson.ObjectId;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `regex` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/regex/}\n */\n export interface Regex<S> {\n /**\n * regex interprets the query field as a regular expression.\n * regex is a term-level operator, meaning that the query field isn't analyzed.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/regex/}\n */\n regex: {\n path: SearchPath<S>;\n query: string;\n allowAnalyzedField?: boolean;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `text` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/text/}\n */\n export interface Text<S> {\n /**\n * The text operator performs a full-text search using the analyzer that you specify in the index configuration.\n * If you omit an analyzer, the text operator uses the default standard analyzer.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/text/}\n */\n text: {\n path: SearchPath<S>;\n query: string;\n fuzzy?: Record<string, unknown>;\n matchCriteria?: string;\n synonyms?: string;\n score?: SearchScore;\n };\n }\n\n /**\n * A type describing the `wildcard` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/wildcard/}\n */\n export interface Wildcard<S> {\n /**\n * The wildcard operator enables queries which use special characters in the search string that can match any character.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-search/wildcard/}\n */\n wildcard: {\n path: SearchPath<S>;\n query: string;\n allowAnalyzedField?: boolean;\n score?: SearchScore;\n };\n }\n}\nexport namespace Aggregation.Stage {\n /**\n * A type describing the `$addFields` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/}\n */\n export interface $addFields<S> {\n /**\n * Adds new fields to documents. Outputs documents that contain all existing fields from the input documents and newly added fields.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/addFields/}\n */\n $addFields: {\n /**\n * Specify the name of each field to add and set its value to an aggregation expression or an empty object.\n */\n } & { [expression: string]: Expression<S> };\n }\n\n /**\n * A type describing the `$bucket` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucket/}\n */\n export interface $bucket<S> {\n /**\n * Categorizes incoming documents into groups, called buckets, based on a specified expression and bucket boundaries.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucket/}\n */\n $bucket: {\n /**\n * An expression to group documents by. To specify a field path, prefix the field name with a dollar sign $ and enclose it in quotes.\n * Unless $bucket includes a default specification, each input document must resolve the groupBy field path or expression to a value that falls within one of the ranges specified by the boundaries.\n */\n groupBy: Expression<S>;\n\n /**\n * An array of values based on the groupBy expression that specify the boundaries for each bucket. Each adjacent pair of values acts as the inclusive lower boundary and the exclusive upper boundary for the bucket. You must specify at least two boundaries.\n * The specified values must be in ascending order and all of the same type. The exception is if the values are of mixed numeric types, such as:\n */\n boundaries: unknown[];\n\n /**\n * A literal that specifies the _id of an additional bucket that contains all documents whose groupBy expression result does not fall into a bucket specified by boundaries.\n * If unspecified, each input document must resolve the groupBy expression to a value within one of the bucket ranges specified by boundaries or the operation throws an error.\n * The default value must be less than the lowest boundaries value, or greater than or equal to the highest boundaries value.\n * The default value can be of a different type than the entries in boundaries.\n */\n default?: Expression<S>;\n\n /**\n * A document that specifies the fields to include in the output documents in addition to the _id field. To specify the field to include, you must use accumulator expressions.\n * If you do not specify an output document, the operation returns a count field containing the number of documents in each bucket.\n * If you specify an output document, only the fields specified in the document are returned; i.e. the count field is not returned unless it is explicitly included in the output document.\n */\n output?: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$bucketAuto` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/}\n */\n export interface $bucketAuto<S> {\n /**\n * Categorizes incoming documents into a specific number of groups, called buckets, based on a specified expression. Bucket boundaries are automatically determined in an attempt to evenly distribute the documents into the specified number of buckets.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/bucketAuto/}\n */\n $bucketAuto: {\n /**\n * An expression to group documents by. To specify a field path, prefix the field name with a dollar sign $ and enclose it in quotes.\n */\n groupBy: Expression<S>;\n\n /**\n * A positive 32-bit integer that specifies the number of buckets into which input documents are grouped.\n */\n buckets: Int;\n\n /**\n * A document that specifies the fields to include in the output documents in addition to the _id field. To specify the field to include, you must use accumulator expressions.\n * The default count field is not included in the output document when output is specified. Explicitly specify the count expression as part of the output document to include it.\n */\n output?: Record<string, unknown>;\n\n /**\n * A string that specifies the preferred number series to use to ensure that the calculated boundary edges end on preferred round numbers or their powers of 10.\n * Available only if the all groupBy values are numeric and none of them are NaN.\n */\n granularity?: Granularity;\n };\n }\n\n /**\n * A type describing the `$changeStream` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStream/}\n */\n export interface $changeStream<S> {\n /**\n * Returns a Change Stream cursor for the collection or database. This stage can only occur once in an aggregation pipeline and it must occur as the first stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStream/}\n */\n $changeStream: {\n /**\n * A flag indicating whether the stream should report all changes that occur on the deployment, aside from those on internal databases or collections.\n */\n allChangesForCluster?: boolean;\n\n /**\n * Specifies whether change notifications include a copy of the full document when modified by update operations.\n */\n fullDocument?: FullDocument;\n\n /**\n * Valid values are \"off\", \"whenAvailable\", or \"required\". If set to \"off\", the \"fullDocumentBeforeChange\" field of the output document is always omitted. If set to \"whenAvailable\", the \"fullDocumentBeforeChange\" field will be populated with the pre-image of the document modified by the current change event if such a pre-image is available, and will be omitted otherwise. If set to \"required\", then the \"fullDocumentBeforeChange\" field is always populated and an exception is thrown if the pre-image is not available.\n */\n fullDocumentBeforeChange?: FullDocumentBeforeChange;\n\n /**\n * Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n */\n resumeAfter?: Int;\n\n /**\n * Specifies whether to include additional change events, such as such as DDL and index operations.\n * New in MongoDB 6.0.\n */\n showExpandedEvents?: boolean;\n\n /**\n * Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n */\n startAfter?: Record<string, unknown>;\n\n /**\n * Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n startAtOperationTime?: bson.Timestamp;\n };\n }\n\n /**\n * A type describing the `$changeStreamSplitLargeEvent` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStreamSplitLargeEvent/}\n */\n export interface $changeStreamSplitLargeEvent<S> {\n /**\n * Splits large change stream events that exceed 16 MB into smaller fragments returned in a change stream cursor.\n * You can only use $changeStreamSplitLargeEvent in a $changeStream pipeline and it must be the final stage in the pipeline.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/changeStreamSplitLargeEvent/}\n */\n $changeStreamSplitLargeEvent: Record<string, never>;\n }\n\n /**\n * A type describing the `$collStats` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/}\n */\n export interface $collStats<S> {\n /**\n * Returns statistics regarding a collection or view.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/collStats/}\n */\n $collStats: {\n latencyStats?: Record<string, unknown>;\n storageStats?: Record<string, unknown>;\n count?: Record<string, unknown>;\n queryExecStats?: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$count` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/}\n */\n export interface $count<S> {\n /**\n * Returns a count of the number of documents at this stage of the aggregation pipeline.\n * Distinct from the $count aggregation accumulator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/count/}\n */\n $count: string;\n }\n\n /**\n * A type describing the `$currentOp` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentOp/}\n */\n export interface $currentOp<S> {\n /**\n * Returns information on active and/or dormant operations for the MongoDB deployment. To run, use the db.aggregate() method.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/currentOp/}\n */\n $currentOp: {\n allUsers?: boolean;\n idleConnections?: boolean;\n idleCursors?: boolean;\n idleSessions?: boolean;\n localOps?: boolean;\n };\n }\n\n /**\n * A type describing the `$densify` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/}\n */\n export interface $densify<S> {\n /**\n * Creates new documents in a sequence of documents where certain values in a field are missing.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/densify/}\n */\n $densify: {\n /**\n * The field to densify. The values of the specified field must either be all numeric values or all dates.\n * Documents that do not contain the specified field continue through the pipeline unmodified.\n * To specify a <field> in an embedded document or in an array, use dot notation.\n */\n field: string;\n\n /**\n * The field(s) that will be used as the partition keys.\n */\n partitionByFields?: unknown[];\n\n /**\n * Specification for range based densification.\n */\n range: Range;\n };\n }\n\n /**\n * A type describing the `$documents` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents/}\n */\n export interface $documents<S> {\n /**\n * Returns literal documents from input values.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/documents/}\n */\n $documents: ResolvesToArray<S>;\n }\n\n /**\n * A type describing the `$facet` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/}\n */\n export interface $facet<S> {\n /**\n * Processes multiple aggregation pipelines within a single stage on the same set of input documents. Enables the creation of multi-faceted aggregations capable of characterizing data across multiple dimensions, or facets, in a single stage.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/facet/}\n */\n $facet: {} & { [facet: string]: Pipeline<S> };\n }\n\n /**\n * A type describing the `$fill` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/}\n */\n export interface $fill<S> {\n /**\n * Populates null and missing field values within documents.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/fill/}\n */\n $fill: {\n /**\n * Specifies an expression to group the documents. In the $fill stage, a group of documents is known as a partition.\n * If you omit partitionBy and partitionByFields, $fill uses one partition for the entire collection.\n * partitionBy and partitionByFields are mutually exclusive.\n */\n partitionBy?: Record<string, unknown> | string;\n\n /**\n * Specifies an array of fields as the compound key to group the documents. In the $fill stage, each group of documents is known as a partition.\n * If you omit partitionBy and partitionByFields, $fill uses one partition for the entire collection.\n * partitionBy and partitionByFields are mutually exclusive.\n */\n partitionByFields?: unknown[];\n\n /**\n * Specifies the field or fields to sort the documents within each partition. Uses the same syntax as the $sort stage.\n */\n sortBy?: SortBy;\n\n /**\n * Specifies an object containing each field for which to fill missing values. You can specify multiple fields in the output object.\n * The object name is the name of the field to fill. The object value specifies how the field is filled.\n */\n output: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$geoNear` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/}\n */\n export interface $geoNear<S> {\n /**\n * Returns an ordered stream of documents based on the proximity to a geospatial point. Incorporates the functionality of $match, $sort, and $limit for geospatial data. The output documents include an additional distance field and can include a location identifier field.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/}\n */\n $geoNear: {\n /**\n * The output field that contains the calculated distance. To specify a field within an embedded document, use dot notation.\n */\n distanceField?: string;\n\n /**\n * The factor to multiply all distances returned by the query. For example, use the distanceMultiplier to convert radians, as returned by a spherical query, to kilometers by multiplying by the radius of the Earth.\n */\n distanceMultiplier?: Number;\n\n /**\n * This specifies the output field that identifies the location used to calculate the distance. This option is useful when a location field contains multiple locations. To specify a field within an embedded document, use dot notation.\n */\n includeLocs?: string;\n\n /**\n * Specify the geospatial indexed field to use when calculating the distance.\n */\n key?: string;\n\n /**\n * The maximum distance from the center point that the documents can be. MongoDB limits the results to those documents that fall within the specified distance from the center point.\n * Specify the distance in meters if the specified point is GeoJSON and in radians if the specified point is legacy coordinate pairs.\n */\n maxDistance?: Number;\n\n /**\n * The minimum distance from the center point that the documents can be. MongoDB limits the results to those documents that fall outside the specified distance from the center point.\n * Specify the distance in meters for GeoJSON data and in radians for legacy coordinate pairs.\n */\n minDistance?: Number;\n\n /**\n * The point for which to find the closest documents.\n */\n near: GeoPoint | ResolvesToObject<S>;\n\n /**\n * Limits the results to the documents that match the query. The query syntax is the usual MongoDB read operation query syntax.\n * You cannot specify a $near predicate in the query field of the $geoNear stage.\n */\n query?: Query<S>;\n\n /**\n * Determines how MongoDB calculates the distance between two points:\n * - When true, MongoDB uses $nearSphere semantics and calculates distances using spherical geometry.\n * - When false, MongoDB uses $near semantics: spherical geometry for 2dsphere indexes and planar geometry for 2d indexes.\n * Default: false.\n */\n spherical?: boolean;\n };\n }\n\n /**\n * A type describing the `$graphLookup` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/}\n */\n export interface $graphLookup<S> {\n /**\n * Performs a recursive search on a collection. To each output document, adds a new array field that contains the traversal results of the recursive search for that document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/graphLookup/}\n */\n $graphLookup: {\n /**\n * Target collection for the $graphLookup operation to search, recursively matching the connectFromField to the connectToField. The from collection must be in the same database as any other collections used in the operation.\n * Starting in MongoDB 5.1, the collection specified in the from parameter can be sharded.\n */\n from: string;\n\n /**\n * Expression that specifies the value of the connectFromField with which to start the recursive search. Optionally, startWith may be array of values, each of which is individually followed through the traversal process.\n */\n startWith: Expression<S> | Expression<S>[];\n\n /**\n * Field name whose value $graphLookup uses to recursively match against the connectToField of other documents in the collection. If the value is an array, each element is individually followed through the traversal process.\n */\n connectFromField: string;\n\n /**\n * Field name in other documents against which to match the value of the field specified by the connectFromField parameter.\n */\n connectToField: string;\n\n /**\n * Name of the array field added to each output document. Contains the documents traversed in the $graphLookup stage to reach the document.\n */\n as: string;\n\n /**\n * Non-negative integral number specifying the maximum recursion depth.\n */\n maxDepth?: Int;\n\n /**\n * Name of the field to add to each traversed document in the search path. The value of this field is the recursion depth for the document, represented as a NumberLong. Recursion depth value starts at zero, so the first lookup corresponds to zero depth.\n */\n depthField?: string;\n\n /**\n * A document specifying additional conditions for the recursive search. The syntax is identical to query filter syntax.\n */\n restrictSearchWithMatch?: Query<S>;\n };\n }\n\n /**\n * A type describing the `$group` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/group/}\n */\n export interface $group<S> {\n /**\n * Groups input documents by a specified identifier expression and applies the accumulator expression(s), if specified, to each group. Consumes all input documents and outputs one document per each distinct group. The output documents only contain the identifier field and, if specified, accumulated fields.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/group/}\n */\n $group: RecordWithStaticFields<\n {\n /**\n * The _id expression specifies the group key. If you specify an _id value of null, or any other constant value, the $group stage returns a single document that aggregates values across all of the input documents.\n */\n _id: Expression<S> | ExpressionMap<S>;\n },\n /**\n * Computed using the accumulator operators.\n */\n Accumulator<S>\n >;\n }\n\n /**\n * A type describing the `$indexStats` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/}\n */\n export interface $indexStats<S> {\n /**\n * Returns statistics regarding the use of each index for the collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/}\n */\n $indexStats: Record<string, never>;\n }\n\n /**\n * A type describing the `$limit` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/limit/}\n */\n export interface $limit<S> {\n /**\n * Passes the first n documents unmodified to the pipeline where n is the specified limit. For each input document, outputs either one document (for the first n documents) or zero documents (after the first n documents).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/limit/}\n */\n $limit: Int;\n }\n\n /**\n * A type describing the `$listLocalSessions` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listLocalSessions/}\n */\n export interface $listLocalSessions<S> {\n /**\n * Lists all active sessions recently in use on the currently connected mongos or mongod instance. These sessions may have not yet propagated to the system.sessions collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listLocalSessions/}\n */\n $listLocalSessions: {\n /**\n * Returns all sessions for the specified users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster to list sessions for other users.\n */\n users?: unknown[];\n\n /**\n * Returns all sessions for all users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster.\n */\n allUsers?: boolean;\n };\n }\n\n /**\n * A type describing the `$listSampledQueries` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSampledQueries/}\n */\n export interface $listSampledQueries<S> {\n /**\n * Lists sampled queries for all collections or a specific collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSampledQueries/}\n */\n $listSampledQueries: { namespace?: string };\n }\n\n /**\n * A type describing the `$listSearchIndexes` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/}\n */\n export interface $listSearchIndexes<S> {\n /**\n * Returns information about existing Atlas Search indexes on a specified collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSearchIndexes/}\n */\n $listSearchIndexes: {\n /**\n * The id of the index to return information about.\n */\n id?: string;\n\n /**\n * The name of the index to return information about.\n */\n name?: string;\n };\n }\n\n /**\n * A type describing the `$listSessions` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSessions/}\n */\n export interface $listSessions<S> {\n /**\n * Lists all sessions that have been active long enough to propagate to the system.sessions collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/listSessions/}\n */\n $listSessions: {\n /**\n * Returns all sessions for the specified users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster to list sessions for other users.\n */\n users?: unknown[];\n\n /**\n * Returns all sessions for all users. If running with access control, the authenticated user must have privileges with listSessions action on the cluster.\n */\n allUsers?: boolean;\n };\n }\n\n /**\n * A type describing the `$lookup` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/}\n */\n export interface $lookup<S> {\n /**\n * Performs a left outer join to another collection in the same database to filter in documents from the \"joined\" collection for processing.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/}\n */\n $lookup: {\n /**\n * Specifies the collection in the same database to perform the join with.\n * from is optional, you can use a $documents stage in a $lookup stage instead. For an example, see Use a $documents Stage in a $lookup Stage.\n * Starting in MongoDB 5.1, the collection specified in the from parameter can be sharded.\n */\n from?: string;\n\n /**\n * Specifies the field from the documents input to the $lookup stage. $lookup performs an equality match on the localField to the foreignField from the documents of the from collection. If an input document does not contain the localField, the $lookup treats the field as having a value of null for matching purposes.\n */\n localField?: string;\n\n /**\n * Specifies the field from the documents in the from collection. $lookup performs an equality match on the foreignField to the localField from the input documents. If a document in the from collection does not contain the foreignField, the $lookup treats the value as null for matching purposes.\n */\n foreignField?: string;\n\n /**\n * Specifies variables to use in the pipeline stages. Use the variable expressions to access the fields from the joined collection's documents that are input to the pipeline.\n */\n let?: Record<string, unknown>;\n\n /**\n * Specifies the pipeline to run on the joined collection. The pipeline determines the resulting documents from the joined collection. To return all documents, specify an empty pipeline [].\n * The pipeline cannot include the $out stage or the $merge stage. Starting in v6.0, the pipeline can contain the Atlas Search $search stage as the first stage inside the pipeline.\n * The pipeline cannot directly access the joined document fields. Instead, define variables for the joined document fields using the let option and then reference the variables in the pipeline stages.\n */\n pipeline?: UntypedPipeline;\n\n /**\n * Specifies the name of the new array field to add to the input documents. The new array field contains the matching documents from the from collection. If the specified name already exists in the input document, the existing field is overwritten.\n */\n as: string;\n };\n }\n\n /**\n * A type describing the `$match` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/match/}\n */\n export interface $match<S> {\n /**\n * Filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage. $match uses standard MongoDB queries. For each input document, outputs either one document (a match) or zero documents (no match).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/match/}\n */\n $match: Query<S>;\n }\n\n /**\n * A type describing the `$merge` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/}\n */\n export interface $merge<S> {\n /**\n * Writes the resulting documents of the aggregation pipeline to a collection. The stage can incorporate (insert new documents, merge documents, replace documents, keep existing documents, fail the operation, process documents with a custom update pipeline) the results into an output collection. To use the $merge stage, it must be the last stage in the pipeline.\n * New in MongoDB 4.2.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/}\n */\n $merge: {\n /**\n * The output collection.\n */\n into: string | OutCollection;\n\n /**\n * Field or fields that act as a unique identifier for a document. The identifier determines if a results document matches an existing document in the output collection.\n */\n on?: string | string[];\n\n /**\n * Specifies variables for use in the whenMatched pipeline.\n */\n let?: Record<string, unknown>;\n\n /**\n * The behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).\n */\n whenMatched?: WhenMatched | UntypedPipeline;\n\n /**\n * The behavior of $merge if a result document does not match an existing document in the out collection.\n */\n whenNotMatched?: WhenNotMatched;\n };\n }\n\n /**\n * A type describing the `$out` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/}\n */\n export interface $out<S> {\n /**\n * Writes the resulting documents of the aggregation pipeline to a collection. To use the $out stage, it must be the last stage in the pipeline.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/}\n */\n $out: string | OutCollection;\n }\n\n /**\n * A type describing the `$planCacheStats` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/}\n */\n export interface $planCacheStats<S> {\n /**\n * Returns plan cache information for a collection.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/}\n */\n $planCacheStats: Record<string, never>;\n }\n\n /**\n * A type describing the `$project` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/project/}\n */\n export interface $project<S> {\n /**\n * Reshapes each document in the stream, such as by adding new fields or removing existing fields. For each input document, outputs one document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/project/}\n */\n $project: {} & {\n [specification: string]: Expression<S> | ExpressionMap<S>;\n };\n }\n\n /**\n * A type describing the `$redact` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/}\n */\n export interface $redact<S> {\n /**\n * Reshapes each document in the stream by restricting the content for each document based on information stored in the documents themselves. Incorporates the functionality of $project and $match. Can be used to implement field level redaction. For each input document, outputs either one or zero documents.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/redact/}\n */\n $redact: Expression<S>;\n }\n\n /**\n * A type describing the `$replaceRoot` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot/}\n */\n export interface $replaceRoot<S> {\n /**\n * Replaces a document with the specified embedded document. The operation replaces all existing fields in the input document, including the _id field. Specify a document embedded in the input document to promote the embedded document to the top level.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceRoot/}\n */\n $replaceRoot: { newRoot: ResolvesToObject<S> };\n }\n\n /**\n * A type describing the `$replaceWith` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceWith/}\n */\n export interface $replaceWith<S> {\n /**\n * Replaces a document with the specified embedded document. The operation replaces all existing fields in the input document, including the _id field. Specify a document embedded in the input document to promote the embedded document to the top level.\n * Alias for $replaceRoot.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/replaceWith/}\n */\n $replaceWith: ResolvesToObject<S>;\n }\n\n /**\n * A type describing the `$sample` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/}\n */\n export interface $sample<S> {\n /**\n * Randomly selects the specified number of documents from its input.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sample/}\n */\n $sample: {\n /**\n * The number of documents to randomly select.\n */\n size: Int;\n };\n }\n\n /**\n * A type describing the `$search` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/search/}\n */\n export interface $search<S> {\n /**\n * Performs a full-text search of the field or fields in an Atlas collection.\n * NOTE: $search is only available for MongoDB Atlas clusters, and is not available for self-managed deployments.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/search/}\n */\n $search: SearchOperator<S> & {\n /**\n * Name of the Atlas Search index to use. If omitted, defaults to \"default\".\n */\n index?: string;\n\n /**\n * Specifies the highlighting options for displaying search terms in their original context.\n */\n highlight?: SearchHighlight<S>;\n\n /**\n * Parallelize search across segments on dedicated search nodes.\n * If you don't have separate search nodes on your cluster,\n * Atlas Search ignores this flag. If omitted, defaults to false.\n */\n concurrent?: boolean;\n\n /**\n * Document that specifies the count options for retrieving a count of the results.\n */\n count?: Record<string, unknown>;\n\n /**\n * Reference point for retrieving results. searchAfter returns documents starting immediately following the specified reference point.\n */\n searchAfter?: string;\n\n /**\n * Reference point for retrieving results. searchBefore returns documents starting immediately before the specified reference point.\n */\n searchBefore?: string;\n\n /**\n * Flag that specifies whether to retrieve a detailed breakdown of the score for the documents in the results. If omitted, defaults to false.\n */\n scoreDetails?: boolean;\n\n /**\n * Document that specifies the fields to sort the Atlas Search results by in ascending or descending order.\n */\n sort?: Record<string, unknown>;\n\n /**\n * Flag that specifies whether to perform a full document lookup on the backend database or return only stored source fields directly from Atlas Search.\n */\n returnStoredSource?: boolean;\n\n /**\n * Document that specifies the tracking option to retrieve analytics information on the search terms.\n */\n tracking?: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$searchMeta` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/searchMeta/}\n */\n export interface $searchMeta<S> {\n /**\n * Returns different types of metadata result documents for the Atlas Search query against an Atlas collection.\n * NOTE: $searchMeta is only available for MongoDB Atlas clusters running MongoDB v4.4.9 or higher, and is not available for self-managed deployments.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/searchMeta/}\n */\n $searchMeta: SearchOperator<S> & {\n /**\n * Name of the Atlas Search index to use. If omitted, defaults to default.\n */\n index?: string;\n\n /**\n * Document that specifies the count options for retrieving a count of the results.\n */\n count?: Record<string, unknown>;\n };\n }\n\n /**\n * A type describing the `$set` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/}\n */\n export interface $set<S> {\n /**\n * Adds new fields to documents. Outputs documents that contain all existing fields from the input documents and newly added fields.\n * Alias for $addFields.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/set/}\n */\n $set: {} & { [field: string]: Expression<S> };\n }\n\n /**\n * A type describing the `$setWindowFields` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/}\n */\n export interface $setWindowFields<S> {\n /**\n * Groups documents into windows and applies one or more operators to the documents in each window.\n * New in MongoDB 5.0.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/}\n */\n $setWindowFields: {\n /**\n * Specifies the field(s) to sort the documents by in the partition. Uses the same syntax as the $sort stage. Default is no sorting.\n */\n sortBy: SortBy;\n\n /**\n * Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage. Each field is set to the result returned by the window operator.\n * A field can contain dots to specify embedded document fields and array fields. The semantics for the embedded document dotted notation in the $setWindowFields stage are the same as the $addFields and $set stages.\n */\n output: Record<string, unknown>;\n\n /**\n * Specifies an expression to group the documents. In the $setWindowFields stage, the group of documents is known as a partition. Default is one partition for the entire collection.\n */\n partitionBy?: Expression<S>;\n };\n }\n\n /**\n * A type describing the `$shardedDataDistribution` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shardedDataDistribution/}\n */\n export interface $shardedDataDistribution<S> {\n /**\n * Provides data and size distribution information on sharded collections.\n * New in MongoDB 6.0.3.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/shardedDataDistribution/}\n */\n $shardedDataDistribution: Record<string, never>;\n }\n\n /**\n * A type describing the `$skip` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip/}\n */\n export interface $skip<S> {\n /**\n * Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline. For each input document, outputs either zero documents (for the first n documents) or one document (if after the first n documents).\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/skip/}\n */\n $skip: Int;\n }\n\n /**\n * A type describing the `$sort` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort/}\n */\n export interface $sort<S> {\n /**\n * Reorders the document stream by a specified sort key. Only the order changes; the documents remain unmodified. For each input document, outputs one document.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sort/}\n */\n $sort: {} & { [sort: string]: Expression<S> | SortSpec };\n }\n\n /**\n * A type describing the `$sortByCount` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/}\n */\n export interface $sortByCount<S> {\n /**\n * Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/sortByCount/}\n */\n $sortByCount: Expression<S>;\n }\n\n /**\n * A type describing the `$unionWith` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/}\n */\n export interface $unionWith<S> {\n /**\n * Performs a union of two collections; i.e. combines pipeline results from two collections into a single result set.\n * New in MongoDB 4.4.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unionWith/}\n */\n $unionWith: {\n /**\n * The collection or view whose pipeline results you wish to include in the result set.\n */\n coll: string;\n\n /**\n * An aggregation pipeline to apply to the specified coll.\n * The pipeline cannot include the $out and $merge stages. Starting in v6.0, the pipeline can contain the Atlas Search $search stage as the first stage inside the pipeline.\n */\n pipeline?: UntypedPipeline;\n };\n }\n\n /**\n * A type describing the `$unset` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/}\n */\n export interface $unset<S> {\n /**\n * Removes or excludes fields from documents.\n * Alias for $project stage that removes or excludes fields.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/}\n */\n $unset: [...UnprefixedFieldPath<S>[]];\n }\n\n /**\n * A type describing the `$unwind` operator.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/}\n */\n export interface $unwind<S> {\n /**\n * Deconstructs an array field from the input documents to output a document for each element. Each output document replaces the array with an element value. For each input document, outputs n documents where n is the number of array elements and can be zero for an empty array.\n * @see {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/}\n */\n $unwind: {\n /**\n * Field path to an array field.\n */\n path: ArrayFieldPath<S>;\n\n /**\n * The name of a new field to hold the array index of the element. The name cannot start with a dollar sign $.\n */\n includeArrayIndex?: string;\n\n /**\n * If true, if the path is null, missing, or an empty array, $unwind outputs the document.\n * If false, if path is null, missing, or an empty array, $unwind does not output a document.\n * The default value is false.\n */\n preserveNullAndEmptyArrays?: boolean;\n };\n }\n\n /**\n * A type describing the `$vectorSearch` operator.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/}\n */\n export interface $vectorSearch<S> {\n /**\n * The $vectorSearch stage performs an ANN or ENN search on a vector in the specified field.\n * @see {@link https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/}\n */\n $vectorSearch: {\n /**\n * Name of the Atlas Vector Search index to use.\n */\n index: string;\n\n /**\n * Number of documents to return in the results. This value can't exceed the value of numCandidates if you specify numCandidates.\n */\n limit: Int;\n\n /**\n * Indexed vector type field to search.\n */\n path: string;\n\n /**\n * Array of numbers that represent the query vector. The number type must match the indexed field value type.\n */\n queryVector: unknown[];\n\n /**\n * This is required if numCandidates is omitted. false to run ANN search. true to run ENN search.\n */\n exact?: boolean;\n\n /**\n * Any match query that compares an indexed field with a boolean, date, objectId, number (not decimals), string, or UUID to use as a pre-filter.\n */\n filter?: Query<S>;\n\n /**\n * This field is required if exact is false or omitted.\n * Number of nearest neighbors to use during the search. Value must be less than or equal to (<=) 10000. You can't specify a number less than the number of documents to return (limit).\n */\n numCandidates?: Int;\n };\n }\n}\n\nexport type Int = number | bson.Int32;\nexport type Double = number | bson.Double;\nexport type Decimal = bson.Decimal128;\nexport type Regex = RegExp | bson.BSONRegExp;\nexport type Long = bigint | bson.Long;\nexport type Javascript = bson.Code | Function | string;\nexport type Geometry<S> =\n | { type: 'Point'; coordinates: number[] }\n | { type: 'MultiPoint'; coordinates: number[][] }\n | { type: 'LineString'; coordinates: number[][] }\n | { type: 'MultiLineString'; coordinates: number[][][] }\n | { type: 'Polygon'; coordinates: number[][][] }\n | { type: 'MultiPolygon'; coordinates: number[][][][] }\n | Aggregation.Query.$box<S>\n | Aggregation.Query.$center<S>\n | Aggregation.Query.$centerSphere<S>\n | Aggregation.Query.$geometry<S>\n | Aggregation.Query.$polygon<S>;\nexport type Number = Int | Long | Double | Decimal;\nexport type BsonPrimitive =\n | Number\n | bson.Binary\n | bson.ObjectId\n | string\n | boolean\n | Date\n | null\n | Regex\n | Javascript\n | bson.Timestamp;\nexport type SearchPath<S> =\n | UnprefixedFieldPath<S>\n | UnprefixedFieldPath<S>[]\n | { wildcard: string };\nexport type SearchScore = unknown;\nexport type Granularity = string;\nexport type FullDocument = string;\nexport type FullDocumentBeforeChange = string;\nexport type AccumulatorPercentile = string;\nexport type Range = unknown;\nexport type SortBy = unknown;\nexport type GeoPoint = unknown;\nexport type SortSpec = -1 | 1;\nexport type TimeUnit =\n | 'year'\n | 'quarter'\n | 'month'\n | 'week'\n | 'day'\n | 'hour'\n | 'minute'\n | 'second'\n | 'millisecond';\nexport type OutCollection = unknown;\nexport type WhenMatched = string;\nexport type WhenNotMatched = string;\nexport type Expression<S> =\n | ExpressionOperator<S>\n | FieldPath<S>\n | BsonPrimitive\n | FieldExpression<S>\n | FieldPath<S>[];\nexport type ExpressionMap<S> = {\n [k: string]: Expression<S> | ExpressionMap<S>;\n};\nexport type Stage<S> =\n | StageOperator<S>\n | Aggregation.Stage.$addFields<S>\n | Aggregation.Stage.$bucket<S>\n | Aggregation.Stage.$bucketAuto<S>\n | Aggregation.Stage.$changeStream<S>\n | Aggregation.Stage.$changeStreamSplitLargeEvent<S>\n | Aggregation.Stage.$collStats<S>\n | Aggregation.Stage.$count<S>\n | Aggregation.Stage.$currentOp<S>\n | Aggregation.Stage.$densify<S>\n | Aggregation.Stage.$documents<S>\n | Aggregation.Stage.$facet<S>\n | Aggregation.Stage.$fill<S>\n | Aggregation.Stage.$geoNear<S>\n | Aggregation.Stage.$graphLookup<S>\n | Aggregation.Stage.$group<S>\n | Aggregation.Stage.$indexStats<S>\n | Aggregation.Stage.$limit<S>\n | Aggregation.Stage.$listLocalSessions<S>\n | Aggregation.Stage.$listSampledQueries<S>\n | Aggregation.Stage.$listSearchIndexes<S>\n | Aggregation.Stage.$listSessions<S>\n | Aggregation.Stage.$lookup<S>\n | Aggregation.Stage.$match<S>\n | Aggregation.Stage.$merge<S>\n | Aggregation.Stage.$out<S>\n | Aggregation.Stage.$planCacheStats<S>\n | Aggregation.Stage.$project<S>\n | Aggregation.Stage.$redact<S>\n | Aggregation.Stage.$replaceRoot<S>\n | Aggregation.Stage.$replaceWith<S>\n | Aggregation.Stage.$sample<S>\n | Aggregation.Stage.$search<S>\n | Aggregation.Stage.$searchMeta<S>\n | Aggregation.Stage.$set<S>\n | Aggregation.Stage.$setWindowFields<S>\n | Aggregation.Stage.$shardedDataDistribution<S>\n | Aggregation.Stage.$skip<S>\n | Aggregation.Stage.$sort<S>\n | Aggregation.Stage.$sortByCount<S>\n | Aggregation.Stage.$unionWith<S>\n | Aggregation.Stage.$unset<S>\n | Aggregation.Stage.$unwind<S>\n | Aggregation.Stage.$vectorSearch<S>;\nexport type Pipeline<S> = Stage<S>[];\nexport type UntypedPipeline = Pipeline<any>;\nexport type Query<S> =\n | QueryOperator<S>\n | Partial<{ [k in keyof S]: Condition<S[k]> }>\n | Aggregation.Query.$and<S>\n | Aggregation.Query.$expr<S>\n | Aggregation.Query.$jsonSchema<S>\n | Aggregation.Query.$nor<S>\n | Aggregation.Query.$or<S>\n | Aggregation.Query.$sampleRate<S>\n | Aggregation.Query.$text<S>\n | Aggregation.Query.$where<S>;\nexport type Accumulator<S> =\n | Aggregation.Accumulator.$accumulator<S>\n | Aggregation.Accumulator.$addToSet<S>\n | Aggregation.Accumulator.$avg<S>\n | Aggregation.Accumulator.$bottom<S>\n | Aggregation.Accumulator.$bottomN<S>\n | Aggregation.Accumulator.$count<S>\n | Aggregation.Accumulator.$first<S>\n | Aggregation.Accumulator.$firstN<S>\n | Aggregation.Accumulator.$last<S>\n | Aggregation.Accumulator.$lastN<S>\n | Aggregation.Accumulator.$max<S>\n | Aggregation.Accumulator.$maxN<S>\n | Aggregation.Accumulator.$median<S>\n | Aggregation.Accumulator.$mergeObjects<S>\n | Aggregation.Accumulator.$min<S>\n | Aggregation.Accumulator.$minN<S>\n | Aggregation.Accumulator.$percentile<S>\n | Aggregation.Accumulator.$push<S>\n | Aggregation.Accumulator.$stdDevPop<S>\n | Aggregation.Accumulator.$stdDevSamp<S>\n | Aggregation.Accumulator.$sum<S>\n | Aggregation.Accumulator.$top<S>\n | Aggregation.Accumulator.$topN<S>;\nexport type SearchHighlight<S> = {\n path:\n | UnprefixedFieldPath<S>\n | UnprefixedFieldPath<S>[]\n | { wildcard: string }\n | '*'\n | MultiAnalyzerSpec<S>\n | (UnprefixedFieldPath<S> | MultiAnalyzerSpec<S>)[];\n\n maxCharsToExamine?: number;\n maxNumPassages?: number;\n};\nexport type FieldPath<S> = `$${AFieldPath<S, any>}`;\nexport type UnprefixedFieldPath<S> = AFieldPath<S, any>;\nexport type NumberFieldPath<S> = `$${AFieldPath<S, Number>}`;\nexport type DoubleFieldPath<S> = `$${AFieldPath<S, Double>}`;\nexport type StringFieldPath<S> = `$${AFieldPath<S, string>}`;\nexport type ObjectFieldPath<S> = `$${AFieldPath<S, Record<string, unknown>>}`;\nexport type ArrayFieldPath<S> = `$${AFieldPath<S, unknown[]>}`;\nexport type BinDataFieldPath<S> = `$${AFieldPath<S, bson.Binary>}`;\nexport type ObjectIdFieldPath<S> = `$${AFieldPath<S, bson.ObjectId>}`;\nexport type BoolFieldPath<S> = `$${AFieldPath<S, boolean>}`;\nexport type DateFieldPath<S> = `$${AFieldPath<S, Date>}`;\nexport type NullFieldPath<S> = `$${AFieldPath<S, null>}`;\nexport type RegexFieldPath<S> = `$${AFieldPath<S, Regex>}`;\nexport type JavascriptFieldPath<S> = `$${AFieldPath<S, Javascript>}`;\nexport type IntFieldPath<S> = `$${AFieldPath<S, Int>}`;\nexport type TimestampFieldPath<S> = `$${AFieldPath<S, bson.Timestamp>}`;\nexport type LongFieldPath<S> = `$${AFieldPath<S, Long>}`;\nexport type DecimalFieldPath<S> = `$${AFieldPath<S, Decimal>}`;\nexport type ResolvesToNumber<S> =\n | ResolvesToAny<S>\n | NumberFieldPath<S>\n | Number\n | ResolvesToInt<S>\n | ResolvesToDouble<S>\n | ResolvesToLong<S>\n | ResolvesToDecimal<S>\n | Aggregation.Expression.$abs<S>\n | Aggregation.Expression.$avg<S>\n | Aggregation.Expression.$pow<S>\n | Aggregation.Expression.$sum<S>;\nexport type ResolvesToDouble<S> =\n | ResolvesToAny<S>\n | DoubleFieldPath<S>\n | Double\n | Aggregation.Expression.$acos<S>\n | Aggregation.Expression.$acosh<S>\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$asin<S>\n | Aggregation.Expression.$asinh<S>\n | Aggregation.Expression.$atan<S>\n | Aggregation.Expression.$atan2<S>\n | Aggregation.Expression.$atanh<S>\n | Aggregation.Expression.$cos<S>\n | Aggregation.Expression.$cosh<S>\n | Aggregation.Expression.$degreesToRadians<S>\n | Aggregation.Expression.$divide<S>\n | Aggregation.Expression.$exp<S>\n | Aggregation.Expression.$ln<S>\n | Aggregation.Expression.$log<S>\n | Aggregation.Expression.$log10<S>\n | Aggregation.Expression.$median<S>\n | Aggregation.Expression.$radiansToDegrees<S>\n | Aggregation.Expression.$rand<S>\n | Aggregation.Expression.$round<S>\n | Aggregation.Expression.$sin<S>\n | Aggregation.Expression.$sinh<S>\n | Aggregation.Expression.$sqrt<S>\n | Aggregation.Expression.$stdDevPop<S>\n | Aggregation.Expression.$stdDevSamp<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$tan<S>\n | Aggregation.Expression.$tanh<S>\n | Aggregation.Expression.$toDouble<S>\n | Aggregation.Query.$rand<S>;\nexport type ResolvesToString<S> =\n | ResolvesToAny<S>\n | StringFieldPath<S>\n | string\n | Aggregation.Expression.$concat<S>\n | Aggregation.Expression.$dateToString<S>\n | Aggregation.Expression.$ltrim<S>\n | Aggregation.Expression.$replaceAll<S>\n | Aggregation.Expression.$replaceOne<S>\n | Aggregation.Expression.$rtrim<S>\n | Aggregation.Expression.$substr<S>\n | Aggregation.Expression.$substrBytes<S>\n | Aggregation.Expression.$substrCP<S>\n | Aggregation.Expression.$toLower<S>\n | Aggregation.Expression.$toString<S>\n | Aggregation.Expression.$toUpper<S>\n | Aggregation.Expression.$trim<S>\n | Aggregation.Expression.$trunc<S>\n | Aggregation.Expression.$type<S>;\nexport type ResolvesToObject<S> =\n | '$$ROOT'\n | ResolvesToAny<S>\n | ObjectFieldPath<S>\n | Record<string, unknown>\n | Aggregation.Expression.$arrayToObject<S>\n | Aggregation.Expression.$dateToParts<S>\n | Aggregation.Expression.$mergeObjects<S>\n | Aggregation.Expression.$regexFind<S>\n | Aggregation.Expression.$setField<S>\n | Aggregation.Expression.$unsetField<S>;\nexport type ResolvesToArray<S> =\n | ResolvesToAny<S>\n | ArrayFieldPath<S>\n | unknown[]\n | Aggregation.Expression.$concatArrays<S>\n | Aggregation.Expression.$filter<S>\n | Aggregation.Expression.$firstN<S>\n | Aggregation.Expression.$lastN<S>\n | Aggregation.Expression.$map<S>\n | Aggregation.Expression.$maxN<S>\n | Aggregation.Expression.$minN<S>\n | Aggregation.Expression.$objectToArray<S>\n | Aggregation.Expression.$percentile<S>\n | Aggregation.Expression.$range<S>\n | Aggregation.Expression.$regexFindAll<S>\n | Aggregation.Expression.$reverseArray<S>\n | Aggregation.Expression.$setDifference<S>\n | Aggregation.Expression.$setIntersection<S>\n | Aggregation.Expression.$setUnion<S>\n | Aggregation.Expression.$slice<S>\n | Aggregation.Expression.$sortArray<S>\n | Aggregation.Expression.$split<S>\n | Aggregation.Expression.$zip<S>;\nexport type ResolvesToBinData<S> =\n | ResolvesToAny<S>\n | BinDataFieldPath<S>\n | bson.Binary;\nexport type ResolvesToObjectId<S> =\n | ResolvesToAny<S>\n | ObjectIdFieldPath<S>\n | bson.ObjectId\n | Aggregation.Expression.$toObjectId<S>;\nexport type ResolvesToBool<S> =\n | ResolvesToAny<S>\n | BoolFieldPath<S>\n | boolean\n | Aggregation.Expression.$allElementsTrue<S>\n | Aggregation.Expression.$and<S>\n | Aggregation.Expression.$anyElementTrue<S>\n | Aggregation.Expression.$eq<S>\n | Aggregation.Expression.$gt<S>\n | Aggregation.Expression.$gte<S>\n | Aggregation.Expression.$in<S>\n | Aggregation.Expression.$isArray<S>\n | Aggregation.Expression.$isNumber<S>\n | Aggregation.Expression.$lt<S>\n | Aggregation.Expression.$lte<S>\n | Aggregation.Expression.$ne<S>\n | Aggregation.Expression.$not<S>\n | Aggregation.Expression.$or<S>\n | Aggregation.Expression.$regexMatch<S>\n | Aggregation.Expression.$setEquals<S>\n | Aggregation.Expression.$setIsSubset<S>\n | Aggregation.Expression.$toBool<S>;\nexport type ResolvesToDate<S> =\n | '$$NOW'\n | ResolvesToAny<S>\n | DateFieldPath<S>\n | Date\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$dateAdd<S>\n | Aggregation.Expression.$dateFromParts<S>\n | Aggregation.Expression.$dateFromString<S>\n | Aggregation.Expression.$dateSubtract<S>\n | Aggregation.Expression.$dateTrunc<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$toDate<S>;\nexport type ResolvesToNull<S> = ResolvesToAny<S> | NullFieldPath<S> | null;\nexport type ResolvesToRegex<S> = ResolvesToAny<S> | RegexFieldPath<S> | Regex;\nexport type ResolvesToJavascript<S> =\n | ResolvesToAny<S>\n | JavascriptFieldPath<S>\n | Javascript;\nexport type ResolvesToInt<S> =\n | ResolvesToAny<S>\n | IntFieldPath<S>\n | Int\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$binarySize<S>\n | Aggregation.Expression.$bitAnd<S>\n | Aggregation.Expression.$bitNot<S>\n | Aggregation.Expression.$bitOr<S>\n | Aggregation.Expression.$bitXor<S>\n | Aggregation.Expression.$bsonSize<S>\n | Aggregation.Expression.$ceil<S>\n | Aggregation.Expression.$cmp<S>\n | Aggregation.Expression.$dateDiff<S>\n | Aggregation.Expression.$dayOfMonth<S>\n | Aggregation.Expression.$dayOfWeek<S>\n | Aggregation.Expression.$dayOfYear<S>\n | Aggregation.Expression.$floor<S>\n | Aggregation.Expression.$hour<S>\n | Aggregation.Expression.$indexOfArray<S>\n | Aggregation.Expression.$indexOfBytes<S>\n | Aggregation.Expression.$indexOfCP<S>\n | Aggregation.Expression.$isoDayOfWeek<S>\n | Aggregation.Expression.$isoWeek<S>\n | Aggregation.Expression.$isoWeekYear<S>\n | Aggregation.Expression.$millisecond<S>\n | Aggregation.Expression.$minute<S>\n | Aggregation.Expression.$mod<S>\n | Aggregation.Expression.$month<S>\n | Aggregation.Expression.$round<S>\n | Aggregation.Expression.$second<S>\n | Aggregation.Expression.$size<S>\n | Aggregation.Expression.$strLenBytes<S>\n | Aggregation.Expression.$strLenCP<S>\n | Aggregation.Expression.$strcasecmp<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$toInt<S>\n | Aggregation.Expression.$week<S>\n | Aggregation.Expression.$year<S>;\nexport type ResolvesToTimestamp<S> =\n | ResolvesToAny<S>\n | TimestampFieldPath<S>\n | bson.Timestamp\n | '$clusterTime';\nexport type ResolvesToLong<S> =\n | ResolvesToAny<S>\n | LongFieldPath<S>\n | Long\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$bitAnd<S>\n | Aggregation.Expression.$bitNot<S>\n | Aggregation.Expression.$bitOr<S>\n | Aggregation.Expression.$bitXor<S>\n | Aggregation.Expression.$round<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$toHashedIndexKey<S>\n | Aggregation.Expression.$toLong<S>\n | Aggregation.Expression.$tsIncrement<S>\n | Aggregation.Expression.$tsSecond<S>;\nexport type ResolvesToDecimal<S> =\n | ResolvesToAny<S>\n | DecimalFieldPath<S>\n | Decimal\n | Aggregation.Expression.$acos<S>\n | Aggregation.Expression.$acosh<S>\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$asin<S>\n | Aggregation.Expression.$asinh<S>\n | Aggregation.Expression.$atan<S>\n | Aggregation.Expression.$atan2<S>\n | Aggregation.Expression.$atanh<S>\n | Aggregation.Expression.$cos<S>\n | Aggregation.Expression.$cosh<S>\n | Aggregation.Expression.$degreesToRadians<S>\n | Aggregation.Expression.$multiply<S>\n | Aggregation.Expression.$radiansToDegrees<S>\n | Aggregation.Expression.$round<S>\n | Aggregation.Expression.$sin<S>\n | Aggregation.Expression.$sinh<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$tan<S>\n | Aggregation.Expression.$tanh<S>\n | Aggregation.Expression.$toDecimal<S>;\nexport type AccumulatorOperator<S> =\n | Aggregation.Accumulator.$accumulator<S>\n | Aggregation.Accumulator.$addToSet<S>\n | Aggregation.Accumulator.$avg<S>\n | Aggregation.Accumulator.$bottom<S>\n | Aggregation.Accumulator.$bottomN<S>\n | Aggregation.Accumulator.$count<S>\n | Aggregation.Accumulator.$covariancePop<S>\n | Aggregation.Accumulator.$covarianceSamp<S>\n | Aggregation.Accumulator.$denseRank<S>\n | Aggregation.Accumulator.$derivative<S>\n | Aggregation.Accumulator.$documentNumber<S>\n | Aggregation.Accumulator.$expMovingAvg<S>\n | Aggregation.Accumulator.$first<S>\n | Aggregation.Accumulator.$firstN<S>\n | Aggregation.Accumulator.$integral<S>\n | Aggregation.Accumulator.$last<S>\n | Aggregation.Accumulator.$lastN<S>\n | Aggregation.Accumulator.$linearFill<S>\n | Aggregation.Accumulator.$locf<S>\n | Aggregation.Accumulator.$max<S>\n | Aggregation.Accumulator.$maxN<S>\n | Aggregation.Accumulator.$median<S>\n | Aggregation.Accumulator.$mergeObjects<S>\n | Aggregation.Accumulator.$min<S>\n | Aggregation.Accumulator.$minN<S>\n | Aggregation.Accumulator.$percentile<S>\n | Aggregation.Accumulator.$push<S>\n | Aggregation.Accumulator.$rank<S>\n | Aggregation.Accumulator.$shift<S>\n | Aggregation.Accumulator.$stdDevPop<S>\n | Aggregation.Accumulator.$stdDevSamp<S>\n | Aggregation.Accumulator.$sum<S>\n | Aggregation.Accumulator.$top<S>\n | Aggregation.Accumulator.$topN<S>;\nexport type Window<S> =\n | Aggregation.Accumulator.$addToSet<S>\n | Aggregation.Accumulator.$avg<S>\n | Aggregation.Accumulator.$bottom<S>\n | Aggregation.Accumulator.$bottomN<S>\n | Aggregation.Accumulator.$count<S>\n | Aggregation.Accumulator.$covariancePop<S>\n | Aggregation.Accumulator.$covarianceSamp<S>\n | Aggregation.Accumulator.$denseRank<S>\n | Aggregation.Accumulator.$derivative<S>\n | Aggregation.Accumulator.$documentNumber<S>\n | Aggregation.Accumulator.$expMovingAvg<S>\n | Aggregation.Accumulator.$first<S>\n | Aggregation.Accumulator.$firstN<S>\n | Aggregation.Accumulator.$integral<S>\n | Aggregation.Accumulator.$last<S>\n | Aggregation.Accumulator.$lastN<S>\n | Aggregation.Accumulator.$linearFill<S>\n | Aggregation.Accumulator.$locf<S>\n | Aggregation.Accumulator.$max<S>\n | Aggregation.Accumulator.$maxN<S>\n | Aggregation.Accumulator.$median<S>\n | Aggregation.Accumulator.$min<S>\n | Aggregation.Accumulator.$minN<S>\n | Aggregation.Accumulator.$percentile<S>\n | Aggregation.Accumulator.$push<S>\n | Aggregation.Accumulator.$rank<S>\n | Aggregation.Accumulator.$shift<S>\n | Aggregation.Accumulator.$stdDevPop<S>\n | Aggregation.Accumulator.$stdDevSamp<S>\n | Aggregation.Accumulator.$sum<S>;\nexport type ExpressionOperator<S> =\n | Aggregation.Expression.$abs<S>\n | Aggregation.Expression.$acos<S>\n | Aggregation.Expression.$acosh<S>\n | Aggregation.Expression.$add<S>\n | Aggregation.Expression.$allElementsTrue<S>\n | Aggregation.Expression.$and<S>\n | Aggregation.Expression.$anyElementTrue<S>\n | Aggregation.Expression.$arrayElemAt<S>\n | Aggregation.Expression.$arrayToObject<S>\n | Aggregation.Expression.$asin<S>\n | Aggregation.Expression.$asinh<S>\n | Aggregation.Expression.$atan<S>\n | Aggregation.Expression.$atan2<S>\n | Aggregation.Expression.$atanh<S>\n | Aggregation.Expression.$avg<S>\n | Aggregation.Expression.$binarySize<S>\n | Aggregation.Expression.$bitAnd<S>\n | Aggregation.Expression.$bitNot<S>\n | Aggregation.Expression.$bitOr<S>\n | Aggregation.Expression.$bitXor<S>\n | Aggregation.Expression.$bsonSize<S>\n | Aggregation.Expression.$case<S>\n | Aggregation.Expression.$ceil<S>\n | Aggregation.Expression.$cmp<S>\n | Aggregation.Expression.$concat<S>\n | Aggregation.Expression.$concatArrays<S>\n | Aggregation.Expression.$cond<S>\n | Aggregation.Expression.$convert<S>\n | Aggregation.Expression.$cos<S>\n | Aggregation.Expression.$cosh<S>\n | Aggregation.Expression.$dateAdd<S>\n | Aggregation.Expression.$dateDiff<S>\n | Aggregation.Expression.$dateFromParts<S>\n | Aggregation.Expression.$dateFromString<S>\n | Aggregation.Expression.$dateSubtract<S>\n | Aggregation.Expression.$dateToParts<S>\n | Aggregation.Expression.$dateToString<S>\n | Aggregation.Expression.$dateTrunc<S>\n | Aggregation.Expression.$dayOfMonth<S>\n | Aggregation.Expression.$dayOfWeek<S>\n | Aggregation.Expression.$dayOfYear<S>\n | Aggregation.Expression.$degreesToRadians<S>\n | Aggregation.Expression.$divide<S>\n | Aggregation.Expression.$eq<S>\n | Aggregation.Expression.$exp<S>\n | Aggregation.Expression.$filter<S>\n | Aggregation.Expression.$first<S>\n | Aggregation.Expression.$firstN<S>\n | Aggregation.Expression.$floor<S>\n | Aggregation.Expression.$function<S>\n | Aggregation.Expression.$getField<S>\n | Aggregation.Expression.$gt<S>\n | Aggregation.Expression.$gte<S>\n | Aggregation.Expression.$hour<S>\n | Aggregation.Expression.$ifNull<S>\n | Aggregation.Expression.$in<S>\n | Aggregation.Expression.$indexOfArray<S>\n | Aggregation.Expression.$indexOfBytes<S>\n | Aggregation.Expression.$indexOfCP<S>\n | Aggregation.Expression.$isArray<S>\n | Aggregation.Expression.$isNumber<S>\n | Aggregation.Expression.$isoDayOfWeek<S>\n | Aggregation.Expression.$isoWeek<S>\n | Aggregation.Expression.$isoWeekYear<S>\n | Aggregation.Expression.$last<S>\n | Aggregation.Expression.$lastN<S>\n | Aggregation.Expression.$let<S>\n | Aggregation.Expression.$literal<S>\n | Aggregation.Expression.$ln<S>\n | Aggregation.Expression.$log<S>\n | Aggregation.Expression.$log10<S>\n | Aggregation.Expression.$lt<S>\n | Aggregation.Expression.$lte<S>\n | Aggregation.Expression.$ltrim<S>\n | Aggregation.Expression.$map<S>\n | Aggregation.Expression.$max<S>\n | Aggregation.Expression.$maxN<S>\n | Aggregation.Expression.$median<S>\n | Aggregation.Expression.$mergeObjects<S>\n | Aggregation.Expression.$meta<S>\n | Aggregation.Expression.$millisecond<S>\n | Aggregation.Expression.$min<S>\n | Aggregation.Expression.$minN<S>\n | Aggregation.Expression.$minute<S>\n | Aggregation.Expression.$mod<S>\n | Aggregation.Expression.$month<S>\n | Aggregation.Expression.$multiply<S>\n | Aggregation.Expression.$ne<S>\n | Aggregation.Expression.$not<S>\n | Aggregation.Expression.$objectToArray<S>\n | Aggregation.Expression.$or<S>\n | Aggregation.Expression.$percentile<S>\n | Aggregation.Expression.$pow<S>\n | Aggregation.Expression.$radiansToDegrees<S>\n | Aggregation.Expression.$rand<S>\n | Aggregation.Expression.$range<S>\n | Aggregation.Expression.$reduce<S>\n | Aggregation.Expression.$regexFind<S>\n | Aggregation.Expression.$regexFindAll<S>\n | Aggregation.Expression.$regexMatch<S>\n | Aggregation.Expression.$replaceAll<S>\n | Aggregation.Expression.$replaceOne<S>\n | Aggregation.Expression.$reverseArray<S>\n | Aggregation.Expression.$round<S>\n | Aggregation.Expression.$rtrim<S>\n | Aggregation.Expression.$second<S>\n | Aggregation.Expression.$setDifference<S>\n | Aggregation.Expression.$setEquals<S>\n | Aggregation.Expression.$setField<S>\n | Aggregation.Expression.$setIntersection<S>\n | Aggregation.Expression.$setIsSubset<S>\n | Aggregation.Expression.$setUnion<S>\n | Aggregation.Expression.$sin<S>\n | Aggregation.Expression.$sinh<S>\n | Aggregation.Expression.$size<S>\n | Aggregation.Expression.$slice<S>\n | Aggregation.Expression.$sortArray<S>\n | Aggregation.Expression.$split<S>\n | Aggregation.Expression.$sqrt<S>\n | Aggregation.Expression.$stdDevPop<S>\n | Aggregation.Expression.$stdDevSamp<S>\n | Aggregation.Expression.$strLenBytes<S>\n | Aggregation.Expression.$strLenCP<S>\n | Aggregation.Expression.$strcasecmp<S>\n | Aggregation.Expression.$substr<S>\n | Aggregation.Expression.$substrBytes<S>\n | Aggregation.Expression.$substrCP<S>\n | Aggregation.Expression.$subtract<S>\n | Aggregation.Expression.$sum<S>\n | Aggregation.Expression.$switch<S>\n | Aggregation.Expression.$tan<S>\n | Aggregation.Expression.$tanh<S>\n | Aggregation.Expression.$toBool<S>\n | Aggregation.Expression.$toDate<S>\n | Aggregation.Expression.$toDecimal<S>\n | Aggregation.Expression.$toDouble<S>\n | Aggregation.Expression.$toHashedIndexKey<S>\n | Aggregation.Expression.$toInt<S>\n | Aggregation.Expression.$toLong<S>\n | Aggregation.Expression.$toLower<S>\n | Aggregation.Expression.$toObjectId<S>\n | Aggregation.Expression.$toString<S>\n | Aggregation.Expression.$toUpper<S>\n | Aggregation.Expression.$trim<S>\n | Aggregation.Expression.$trunc<S>\n | Aggregation.Expression.$tsIncrement<S>\n | Aggregation.Expression.$tsSecond<S>\n | Aggregation.Expression.$type<S>\n | Aggregation.Expression.$unsetField<S>\n | Aggregation.Expression.$week<S>\n | Aggregation.Expression.$year<S>\n | Aggregation.Expression.$zip<S>;\nexport type ResolvesToAny<S> =\n | Aggregation.Expression.$arrayElemAt<S>\n | Aggregation.Expression.$cond<S>\n | Aggregation.Expression.$convert<S>\n | Aggregation.Expression.$first<S>\n | Aggregation.Expression.$function<S>\n | Aggregation.Expression.$getField<S>\n | Aggregation.Expression.$ifNull<S>\n | Aggregation.Expression.$last<S>\n | Aggregation.Expression.$let<S>\n | Aggregation.Expression.$literal<S>\n | Aggregation.Expression.$max<S>\n | Aggregation.Expression.$meta<S>\n | Aggregation.Expression.$min<S>\n | Aggregation.Expression.$reduce<S>\n | Aggregation.Expression.$switch<S>;\nexport type SwitchBranch<S> = Aggregation.Expression.$case<S>;\nexport type FieldQuery<S> =\n | Aggregation.Query.$all<S>\n | Aggregation.Query.$bitsAllClear<S>\n | Aggregation.Query.$bitsAllSet<S>\n | Aggregation.Query.$bitsAnyClear<S>\n | Aggregation.Query.$bitsAnySet<S>\n | Aggregation.Query.$elemMatch<S>\n | Aggregation.Query.$eq<S>\n | Aggregation.Query.$exists<S>\n | Aggregation.Query.$geoIntersects<S>\n | Aggregation.Query.$geoWithin<S>\n | Aggregation.Query.$gt<S>\n | Aggregation.Query.$gte<S>\n | Aggregation.Query.$in<S>\n | Aggregation.Query.$lt<S>\n | Aggregation.Query.$lte<S>\n | Aggregation.Query.$maxDistance<S>\n | Aggregation.Query.$minDistance<S>\n | Aggregation.Query.$mod<S>\n | Aggregation.Query.$ne<S>\n | Aggregation.Query.$near<S>\n | Aggregation.Query.$nearSphere<S>\n | Aggregation.Query.$nin<S>\n | Aggregation.Query.$not<S>\n | Aggregation.Query.$regex<S>\n | Aggregation.Query.$size<S>\n | Aggregation.Query.$type<S>;\nexport type QueryOperator<S> =\n | Aggregation.Query.$all<S>\n | Aggregation.Query.$and<S>\n | Aggregation.Query.$bitsAllClear<S>\n | Aggregation.Query.$bitsAllSet<S>\n | Aggregation.Query.$bitsAnyClear<S>\n | Aggregation.Query.$bitsAnySet<S>\n | Aggregation.Query.$box<S>\n | Aggregation.Query.$center<S>\n | Aggregation.Query.$centerSphere<S>\n | Aggregation.Query.$elemMatch<S>\n | Aggregation.Query.$eq<S>\n | Aggregation.Query.$exists<S>\n | Aggregation.Query.$expr<S>\n | Aggregation.Query.$geoIntersects<S>\n | Aggregation.Query.$geoWithin<S>\n | Aggregation.Query.$geometry<S>\n | Aggregation.Query.$gt<S>\n | Aggregation.Query.$gte<S>\n | Aggregation.Query.$in<S>\n | Aggregation.Query.$jsonSchema<S>\n | Aggregation.Query.$lt<S>\n | Aggregation.Query.$lte<S>\n | Aggregation.Query.$maxDistance<S>\n | Aggregation.Query.$minDistance<S>\n | Aggregation.Query.$mod<S>\n | Aggregation.Query.$ne<S>\n | Aggregation.Query.$near<S>\n | Aggregation.Query.$nearSphere<S>\n | Aggregation.Query.$nin<S>\n | Aggregation.Query.$nor<S>\n | Aggregation.Query.$not<S>\n | Aggregation.Query.$or<S>\n | Aggregation.Query.$polygon<S>\n | Aggregation.Query.$rand<S>\n | Aggregation.Query.$regex<S>\n | Aggregation.Query.$sampleRate<S>\n | Aggregation.Query.$size<S>\n | Aggregation.Query.$text<S>\n | Aggregation.Query.$type<S>\n | Aggregation.Query.$where<S>;\nexport type SearchOperator<S> =\n | Aggregation.Search.Autocomplete<S>\n | Aggregation.Search.Compound<S>\n | Aggregation.Search.EmbeddedDocument<S>\n | Aggregation.Search.Equals<S>\n | Aggregation.Search.Exists<S>\n | Aggregation.Search.Facet<S>\n | Aggregation.Search.GeoShape<S>\n | Aggregation.Search.GeoWithin<S>\n | Aggregation.Search.In<S>\n | Aggregation.Search.MoreLikeThis<S>\n | Aggregation.Search.Near<S>\n | Aggregation.Search.Phrase<S>\n | Aggregation.Search.QueryString<S>\n | Aggregation.Search.Range<S>\n | Aggregation.Search.Regex<S>\n | Aggregation.Search.Text<S>\n | Aggregation.Search.Wildcard<S>;\nexport type StageOperator<S> =\n | Aggregation.Stage.$addFields<S>\n | Aggregation.Stage.$bucket<S>\n | Aggregation.Stage.$bucketAuto<S>\n | Aggregation.Stage.$changeStream<S>\n | Aggregation.Stage.$changeStreamSplitLargeEvent<S>\n | Aggregation.Stage.$collStats<S>\n | Aggregation.Stage.$count<S>\n | Aggregation.Stage.$currentOp<S>\n | Aggregation.Stage.$densify<S>\n | Aggregation.Stage.$documents<S>\n | Aggregation.Stage.$facet<S>\n | Aggregation.Stage.$fill<S>\n | Aggregation.Stage.$geoNear<S>\n | Aggregation.Stage.$graphLookup<S>\n | Aggregation.Stage.$group<S>\n | Aggregation.Stage.$indexStats<S>\n | Aggregation.Stage.$limit<S>\n | Aggregation.Stage.$listLocalSessions<S>\n | Aggregation.Stage.$listSampledQueries<S>\n | Aggregation.Stage.$listSearchIndexes<S>\n | Aggregation.Stage.$listSessions<S>\n | Aggregation.Stage.$lookup<S>\n | Aggregation.Stage.$match<S>\n | Aggregation.Stage.$merge<S>\n | Aggregation.Stage.$out<S>\n | Aggregation.Stage.$planCacheStats<S>\n | Aggregation.Stage.$project<S>\n | Aggregation.Stage.$redact<S>\n | Aggregation.Stage.$replaceRoot<S>\n | Aggregation.Stage.$replaceWith<S>\n | Aggregation.Stage.$sample<S>\n | Aggregation.Stage.$search<S>\n | Aggregation.Stage.$searchMeta<S>\n | Aggregation.Stage.$set<S>\n | Aggregation.Stage.$setWindowFields<S>\n | Aggregation.Stage.$shardedDataDistribution<S>\n | Aggregation.Stage.$skip<S>\n | Aggregation.Stage.$sort<S>\n | Aggregation.Stage.$sortByCount<S>\n | Aggregation.Stage.$unionWith<S>\n | Aggregation.Stage.$unset<S>\n | Aggregation.Stage.$unwind<S>\n | Aggregation.Stage.$vectorSearch<S>;\n" };
4
- exports.default = files;
5
- //# sourceMappingURL=autocomplete-types.js.map