From af6306f935ca37427b3eb3ae41e42c8d4bdc8114 Mon Sep 17 00:00:00 2001 From: baileympearson <23407842+baileympearson@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:50:19 +0000 Subject: [PATCH] [create-pull-request] automated change --- docs/404.html | 32 +++++++-------- docs/Next/assets/navigation.js | 2 +- docs/Next/assets/search.js | 2 +- docs/Next/classes/BSON.ObjectId.html | 36 ++++++++--------- docs/Next/classes/Batch.html | 4 +- docs/Next/classes/BulkOperationBase.html | 10 ++--- docs/Next/classes/BulkWriteResult.html | 32 +++++++-------- docs/Next/classes/ChangeStream.html | 28 ++++++------- docs/Next/classes/ClientSession.html | 35 ++++++++--------- docs/Next/classes/Collection.html | 39 ++++++++++--------- docs/Next/classes/FindOperators.html | 22 +++++------ docs/Next/classes/MongoAPIError.html | 8 ++-- docs/Next/classes/MongoAWSError.html | 8 ++-- docs/Next/classes/MongoAzureError.html | 8 ++-- .../classes/MongoBatchReExecutionError.html | 8 ++-- docs/Next/classes/MongoBulkWriteError.html | 24 ++++++------ docs/Next/classes/MongoChangeStreamError.html | 8 ++-- docs/Next/classes/MongoClient.html | 34 ++++++++-------- .../MongoClientBulkWriteCursorError.html | 8 ++-- .../classes/MongoClientBulkWriteError.html | 16 ++++---- .../MongoClientBulkWriteExecutionError.html | 8 ++-- .../Next/classes/MongoCompatibilityError.html | 8 ++-- .../MongoCryptAzureKMSRequestError.html | 6 +-- .../classes/MongoCryptCreateDataKeyError.html | 6 +-- ...goCryptCreateEncryptedCollectionError.html | 6 +-- docs/Next/classes/MongoCryptError.html | 6 +-- .../MongoCryptInvalidArgumentError.html | 6 +-- ...ngoCryptKMSRequestNetworkTimeoutError.html | 6 +-- .../classes/MongoCursorExhaustedError.html | 8 ++-- docs/Next/classes/MongoCursorInUseError.html | 8 ++-- .../Next/classes/MongoDecompressionError.html | 8 ++-- docs/Next/classes/MongoDriverError.html | 8 ++-- docs/Next/classes/MongoError.html | 8 ++-- .../classes/MongoExpiredSessionError.html | 8 ++-- docs/Next/classes/MongoGCPError.html | 8 ++-- docs/Next/classes/MongoGridFSChunkError.html | 8 ++-- docs/Next/classes/MongoGridFSStreamError.html | 8 ++-- .../classes/MongoInvalidArgumentError.html | 8 ++-- docs/Next/classes/MongoKerberosError.html | 8 ++-- .../classes/MongoMissingCredentialsError.html | 8 ++-- .../classes/MongoMissingDependencyError.html | 10 ++--- docs/Next/classes/MongoNetworkError.html | 8 ++-- .../classes/MongoNetworkTimeoutError.html | 8 ++-- docs/Next/classes/MongoNotConnectedError.html | 8 ++-- docs/Next/classes/MongoOIDCError.html | 8 ++-- .../classes/MongoOperationTimeoutError.html | 8 ++-- docs/Next/classes/MongoParseError.html | 8 ++-- docs/Next/classes/MongoRuntimeError.html | 8 ++-- docs/Next/classes/MongoServerClosedError.html | 8 ++-- docs/Next/classes/MongoServerError.html | 10 ++--- .../classes/MongoServerSelectionError.html | 10 ++--- docs/Next/classes/MongoStalePrimaryError.html | 29 ++++++++++++++ docs/Next/classes/MongoSystemError.html | 10 ++--- .../classes/MongoTailableCursorError.html | 8 ++-- .../classes/MongoTopologyClosedError.html | 8 ++-- docs/Next/classes/MongoTransactionError.html | 8 ++-- .../MongoUnexpectedServerResponseError.html | 8 ++-- docs/Next/classes/MongoWriteConcernError.html | 12 +++--- docs/Next/classes/OrderedBulkOperation.html | 8 ++-- docs/Next/classes/ServerCapabilities.html | 4 +- docs/Next/classes/ServerDescription.html | 10 ++--- docs/Next/classes/ServerSession.html | 6 +-- docs/Next/classes/UnorderedBulkOperation.html | 8 ++-- docs/Next/classes/WriteConcernError.html | 10 ++--- docs/Next/classes/WriteError.html | 14 +++---- docs/Next/hierarchy.html | 2 +- docs/Next/index.html | 9 ++++- .../interfaces/BulkWriteOperationError.html | 4 +- docs/Next/interfaces/BulkWriteOptions.html | 10 ++--- .../ChangeStreamCollModDocument.html | 16 ++++---- .../ChangeStreamCreateDocument.html | 16 ++++---- .../ChangeStreamCreateIndexDocument.html | 18 ++++----- .../ChangeStreamDeleteDocument.html | 22 +++++------ .../ChangeStreamDocumentCollectionUUID.html | 4 +- .../ChangeStreamDocumentCommon.html | 12 +++--- .../interfaces/ChangeStreamDocumentKey.html | 4 +- ...ngeStreamDocumentOperationDescription.html | 4 +- .../ChangeStreamDropDatabaseDocument.html | 16 ++++---- .../interfaces/ChangeStreamDropDocument.html | 18 ++++----- .../ChangeStreamDropIndexDocument.html | 18 ++++----- .../ChangeStreamInsertDocument.html | 22 +++++------ .../ChangeStreamInvalidateDocument.html | 14 +++---- .../interfaces/ChangeStreamNameSpace.html | 4 +- docs/Next/interfaces/ChangeStreamOptions.html | 18 ++++----- ...treamRefineCollectionShardKeyDocument.html | 18 ++++----- .../ChangeStreamRenameDocument.html | 20 +++++----- .../ChangeStreamReplaceDocument.html | 22 +++++------ ...ChangeStreamReshardCollectionDocument.html | 18 ++++----- .../ChangeStreamShardCollectionDocument.html | 18 ++++----- .../interfaces/ChangeStreamSplitEvent.html | 6 +-- .../ChangeStreamUpdateDocument.html | 26 ++++++------- docs/Next/interfaces/CloseOptions.html | 4 +- docs/Next/interfaces/ConnectOptions.html | 4 +- .../interfaces/ConnectionPoolOptions.html | 14 +++---- docs/Next/interfaces/DeleteManyModel.html | 8 ++-- docs/Next/interfaces/DeleteOneModel.html | 8 ++-- docs/Next/interfaces/EndSessionOptions.html | 6 +-- docs/Next/interfaces/ErrorDescription.html | 4 +- docs/Next/interfaces/InsertOneModel.html | 4 +- .../interfaces/MongoNetworkErrorOptions.html | 4 +- docs/Next/interfaces/MongoOptions.html | 34 ++++++++-------- docs/Next/interfaces/MonitorOptions.html | 10 ++--- docs/Next/interfaces/ReplaceOneModel.html | 12 +++--- docs/Next/interfaces/ResumeOptions.html | 4 +- docs/Next/interfaces/SelectServerOptions.html | 6 +-- docs/Next/interfaces/UpdateDescription.html | 10 ++--- docs/Next/interfaces/UpdateManyModel.html | 14 +++---- docs/Next/interfaces/UpdateOneModel.html | 14 +++---- .../interfaces/WriteConcernErrorData.html | 4 +- .../interfaces/WriteConcernErrorResult.html | 4 +- docs/Next/modules.html | 1 + docs/Next/types/AnyBulkWriteOperation.html | 2 +- docs/Next/types/BatchType.html | 2 +- docs/Next/types/ChangeStreamDocument.html | 2 +- docs/Next/types/ChangeStreamEvents.html | 4 +- docs/Next/types/ConnectionPoolEvents.html | 2 +- docs/Next/types/MongoErrorLabel.html | 2 +- docs/Next/types/MonitorEvents.html | 2 +- docs/Next/types/OperationTime.html | 2 +- docs/Next/types/ResumeToken.html | 2 +- docs/Next/types/ServerEvents.html | 2 +- docs/Next/types/ServerMonitoringMode.html | 2 +- docs/Next/types/ServerSessionId.html | 2 +- docs/Next/types/TopologyEvents.html | 2 +- docs/Next/variables/BatchType-1.html | 2 +- docs/Next/variables/MongoErrorLabel-1.html | 2 +- .../variables/ServerMonitoringMode-1.html | 2 +- docs/categories/index.xml | 5 +-- docs/index.html | 34 ++++++++-------- docs/index.xml | 5 +-- docs/tags/index.xml | 5 +-- 131 files changed, 697 insertions(+), 663 deletions(-) create mode 100644 docs/Next/classes/MongoStalePrimaryError.html diff --git a/docs/404.html b/docs/404.html index 1a8ae099da8..ef939e8cf63 100644 --- a/docs/404.html +++ b/docs/404.html @@ -7,16 +7,16 @@ - + 404 Page not found - - - - - - + + + + + + @@ -26,8 +26,8 @@
@@ -81,13 +81,13 @@

404: Page not found

- - - - - - - + + + + + + +

Class Batch<T>

Keeps the state of a unordered batch so we can rewrite the results correctly after command execution

-

Type Parameters

Constructors

Type Parameters

Constructors

Properties

batchType: BatchType
currentIndex: number
operations: T[]
originalIndexes: number[]
originalZeroIndex: number
size: number
sizeBytes: number
+

Constructors

Properties

batchType: BatchType
currentIndex: number
operations: T[]
originalIndexes: number[]
originalZeroIndex: number
size: number
sizeBytes: number
diff --git a/docs/Next/classes/BulkOperationBase.html b/docs/Next/classes/BulkOperationBase.html index d1486059b1f..15483d66b58 100644 --- a/docs/Next/classes/BulkOperationBase.html +++ b/docs/Next/classes/BulkOperationBase.html @@ -1,4 +1,4 @@ -BulkOperationBase | mongodb

Class BulkOperationBaseAbstract

Hierarchy (view full)

Properties

isOrdered +BulkOperationBase | mongodb

Class BulkOperationBaseAbstract

Hierarchy (view full)

Properties

Accessors

batches bsonOptions @@ -9,14 +9,14 @@ find insert raw -

Properties

isOrdered: boolean
operationId?: number

Accessors

Methods

  • Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. +

Properties

isOrdered: boolean
operationId?: number

Accessors

Methods

  • Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. Returns a builder object used to complete the definition of the operation.

    Parameters

    Returns FindOperators

    const bulkOp = collection.initializeOrderedBulkOp();

    // Add an updateOne to the bulkOp
    bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } });

    // Add an updateMany to the bulkOp
    bulkOp.find({ c: 3 }).update({ $set: { d: 4 } });

    // Add an upsert
    bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } });

    // Add a deletion
    bulkOp.find({ g: 7 }).deleteOne();

    // Add a multi deletion
    bulkOp.find({ h: 8 }).delete();

    // Add a replaceOne
    bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }});

    // Update using a pipeline (requires Mongodb 4.2 or higher)
    bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([
    { $set: { total: { $sum: [ '$y', '$z' ] } } }
    ]);

    // All of the ops will now be executed
    await bulkOp.execute();
    -
  • Add a single insert document to the bulk operation

    Parameters

    Returns BulkOperationBase

    const bulkOp = collection.initializeOrderedBulkOp();

    // Adds three inserts to the bulkOp.
    bulkOp
    .insert({ a: 1 })
    .insert({ b: 2 })
    .insert({ c: 3 });
    await bulkOp.execute();
    -
+
diff --git a/docs/Next/classes/BulkWriteResult.html b/docs/Next/classes/BulkWriteResult.html index 1ba3638d474..1d25108bd1c 100644 --- a/docs/Next/classes/BulkWriteResult.html +++ b/docs/Next/classes/BulkWriteResult.html @@ -1,5 +1,5 @@ BulkWriteResult | mongodb

Class BulkWriteResult

The result of a bulk write.

-

Properties

Properties

deletedCount: number

Number of documents deleted.

-
insertedCount: number

Number of documents inserted.

-
insertedIds: {
    [key: number]: any;
}

Inserted document generated Id's, hash key is the index of the originating operation

-
matchedCount: number

Number of documents matched for update.

-
modifiedCount: number

Number of documents modified.

-
upsertedCount: number

Number of documents upserted.

-
upsertedIds: {
    [key: number]: any;
}

Upserted document generated Id's, hash key is the index of the originating operation

-

Accessors

  • get ok(): number
  • Evaluates to true if the bulk operation correctly executes

    -

    Returns number

Methods

  • Returns the number of write errors off the bulk operation

    -

    Returns number

  • Returns true if the bulk operation contains a write error

    -

    Returns boolean

+
insertedCount: number

Number of documents inserted.

+
insertedIds: {
    [key: number]: any;
}

Inserted document generated Id's, hash key is the index of the originating operation

+
matchedCount: number

Number of documents matched for update.

+
modifiedCount: number

Number of documents modified.

+
upsertedCount: number

Number of documents upserted.

+
upsertedIds: {
    [key: number]: any;
}

Upserted document generated Id's, hash key is the index of the originating operation

+

Accessors

  • get ok(): number
  • Evaluates to true if the bulk operation correctly executes

    +

    Returns number

Methods

  • Returns the number of write errors off the bulk operation

    +

    Returns number

  • Returns true if the bulk operation contains a write error

    +

    Returns boolean

diff --git a/docs/Next/classes/ChangeStream.html b/docs/Next/classes/ChangeStream.html index 9622972da5d..8c0145d7246 100644 --- a/docs/Next/classes/ChangeStream.html +++ b/docs/Next/classes/ChangeStream.html @@ -1,5 +1,5 @@ ChangeStream | mongodb

Class ChangeStream<TSchema, TChange>

Creates a new Change Stream instance. Normally created using Collection.watch().

-

Type Parameters

Hierarchy (view full)

Implements

Properties

Type Parameters

Hierarchy (view full)

Implements

Properties

[asyncDispose]: (() => Promise<void>)

An alias for ChangeStream.close|ChangeStream.close().

-
namespace: MongoDBNamespace
options: ChangeStreamOptions & {
    writeConcern?: undefined;
}

WriteConcern can still be present on the options because +

namespace: MongoDBNamespace
options: ChangeStreamOptions & {
    writeConcern?: undefined;
}

WriteConcern can still be present on the options because we inherit options from the client/db/collection. The key must be present on the options in order to delete it. This allows typescript to delete the key but will not allow a writeConcern to be assigned as a property on options.

-
pipeline: Document[]
streamOptions?: CursorStreamOptions
type: symbol
captureRejections: boolean

Value: boolean

+
pipeline: Document[]
streamOptions?: CursorStreamOptions
type: symbol
captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -64,7 +64,7 @@
CHANGE: "change" = CHANGE

Fired for each new matching change in the specified namespace. Attaching a change event listener to a Change Stream will switch the stream into flowing mode. Data will then be passed as soon as it is available.

-
CLOSE: "close" = CLOSE
defaultMaxListeners: number

By default, a maximum of 10 listeners can be registered for any single +

CLOSE: "close" = CLOSE
defaultMaxListeners: number

By default, a maximum of 10 listeners can be registered for any single event. This limit can be changed for individual EventEmitter instances using the emitter.setMaxListeners(n) method. To change the default for allEventEmitter instances, the events.defaultMaxListeners property @@ -89,21 +89,21 @@ listeners, respectively. Its name property is set to 'MaxListenersExceededWarning'.

v0.11.2

-
END: "end" = END
ERROR: "error" = ERROR
errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

+
END: "end" = END
ERROR: "error" = ERROR
errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-
INIT: "init" = INIT
MORE: "more" = MORE
RESPONSE: "response" = RESPONSE
RESUME_TOKEN_CHANGED: "resumeTokenChanged" = RESUME_TOKEN_CHANGED

Emitted each time the change stream stores a new resume token.

-

Accessors

  • get resumeToken(): unknown
  • The cached resume token that is used to resume after the most recently returned change.

    -

    Returns unknown

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

INIT: "init" = INIT
MORE: "more" = MORE
RESPONSE: "response" = RESPONSE
RESUME_TOKEN_CHANGED: "resumeTokenChanged" = RESUME_TOKEN_CHANGED

Emitted each time the change stream stores a new resume token.

+

Accessors

  • get resumeToken(): unknown
  • The cached resume token that is used to resume after the most recently returned change.

    +

    Returns unknown

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Frees the internal resources used by the change stream.

    -

    Returns Promise<void>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    Returns Promise<void>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -120,7 +120,7 @@ set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Check if there is any document still available in the Change Stream

    -

    Returns Promise<boolean>

  • Returns the number of listeners listening for the event named eventName. +

    Returns Promise<boolean>

  • Try to get the next available document from the Change Stream's cursor or null if an empty batch is returned

    -

    Returns Promise<null | TChange>

  • Experimental

    Listens once to the abort event on the provided signal.

    +
  • Try to get the next available document from the Change Stream's cursor or null if an empty batch is returned

    +

    Returns Promise<null | TChange>

  • Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession

    Parameters

    • clusterTime: ClusterTime

      the $clusterTime returned by the server from another session in the form of a document containing the BSON.Timestamp clusterTime and signature

      -

    Returns void

  • Advances the operationTime for a ClientSession.

    +

Returns void

  • Advances the operationTime for a ClientSession.

    Parameters

    • operationTime: Timestamp

      the BSON.Timestamp of the operation type it is desired to advance to

      -

    Returns void

  • Commits the currently active transaction in this session.

    +

Returns void

  • Commits the currently active transaction in this session.

    Parameters

    • Optionaloptions: {
          timeoutMS?: number;
      }

      Optional options, can be used to override defaultTimeoutMS.

      -
      • OptionaltimeoutMS?: number

    Returns Promise<void>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    • OptionaltimeoutMS?: number

Returns Promise<void>

  • Used to determine if this session equals another

    +

Returns Promise<void>

  • Used to determine if this session equals another

    Parameters

    Returns boolean

  • Returns an array listing the events for which the emitter has registered +

Returns boolean

  • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

    import { EventEmitter } from 'node:events';

    const myEE = new EventEmitter();
    myEE.on('foo', () => {});
    myEE.on('bar', () => {});

    const sym = Symbol('symbol');
    myEE.on(sym, () => {});

    console.log(myEE.eventNames());
    // Prints: [ 'foo', 'bar', Symbol(symbol) ]
    @@ -129,8 +128,8 @@ set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Increment the transaction number on the internal ServerSession

    -

    Returns void

  • Returns boolean

    whether this session is currently in a transaction or not

    -
  • Returns the number of listeners listening for the event named eventName. +

    Returns void

  • Returns boolean

    whether this session is currently in a transaction or not

    +
  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • EventKey extends "ended"

    Parameters

    Returns number

    v3.2.0

    @@ -387,8 +386,8 @@

Returns void

IMPORTANT: Running operations in parallel is not supported during a transaction. The use of Promise.all, Promise.allSettled, Promise.race, etc to parallelize operations inside a transaction is undefined behaviour.

-
  • This is here to ensure that ClientSession is never serialized to BSON.

    -

    Returns never

  • Starts a transaction and runs a provided function, ensuring the commitTransaction is always attempted when all operations run in the function have completed.

    +
  • This is here to ensure that ClientSession is never serialized to BSON.

    +

    Returns never

  • Experimental

    Listens once to the abort event on the provided signal.

    +
  • Experimental

    Listens once to the abort event on the provided signal.

    Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change @@ -504,4 +503,4 @@

  • Rest...eventTargets: (EventEmitter<DefaultEventMap> | EventTarget)[]

    Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} objects.

Returns void

v15.4.0

-
+
diff --git a/docs/Next/classes/Collection.html b/docs/Next/classes/Collection.html index f9b1c6cc87a..aee4faebfcc 100644 --- a/docs/Next/classes/Collection.html +++ b/docs/Next/classes/Collection.html @@ -64,7 +64,7 @@

Returns undefined | WriteConcern

Methods

  • Perform a bulkWrite operation without a fluent API

    +

Returns AggregationCursor<T>

  • Perform a bulkWrite operation without a fluent API

    Legal operation types are

    • insertOne
    • @@ -87,9 +87,10 @@

    Parameters

    Returns Promise<number>

    use Collection#countDocuments| countDocuments or Collection#estimatedDocumentCount| estimatedDocumentCount instead

    -
  • Gets the number of documents matching the filter. -For a fast count of the total documents in a collection see Collection#estimatedDocumentCount| estimatedDocumentCount. -Note: When migrating from Collection#count| count to Collection#countDocuments| countDocuments +

diff --git a/docs/Next/interfaces/ChangeStreamCreateIndexDocument.html b/docs/Next/interfaces/ChangeStreamCreateIndexDocument.html index b10ac15b1ec..441a2c27155 100644 --- a/docs/Next/interfaces/ChangeStreamCreateIndexDocument.html +++ b/docs/Next/interfaces/ChangeStreamCreateIndexDocument.html @@ -1,6 +1,6 @@ ChangeStreamCreateIndexDocument | mongodb

Interface ChangeStreamCreateIndexDocument

Only present when the showExpandedEvents flag is enabled.

interface ChangeStreamCreateIndexDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "createIndexes";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamCreateIndexDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "createIndexes";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationDescription?: Document

An description of the operation.

+
operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
operationType: "createIndexes"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "createIndexes"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDeleteDocument.html b/docs/Next/interfaces/ChangeStreamDeleteDocument.html index f6c1d3a7595..ded0355552c 100644 --- a/docs/Next/interfaces/ChangeStreamDeleteDocument.html +++ b/docs/Next/interfaces/ChangeStreamDeleteDocument.html @@ -1,5 +1,5 @@ ChangeStreamDeleteDocument | mongodb

Interface ChangeStreamDeleteDocument<TSchema>

interface ChangeStreamDeleteDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "delete";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

_id +
interface ChangeStreamDeleteDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "delete";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-
documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. +

documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. For sharded collections, this will contain all the components of the shard key

-
fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the +

fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the pre-image is available for the change event and either 'required' or 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option when creating the change stream. If 'whenAvailable' was specified but the pre-image is unavailable, this will be explicitly set to null.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

Namespace the delete event occurred on

-
operationType: "delete"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

Namespace the delete event occurred on

+
operationType: "delete"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDocumentCollectionUUID.html b/docs/Next/interfaces/ChangeStreamDocumentCollectionUUID.html index 122ad87d67b..8abf52eb298 100644 --- a/docs/Next/interfaces/ChangeStreamDocumentCollectionUUID.html +++ b/docs/Next/interfaces/ChangeStreamDocumentCollectionUUID.html @@ -1,7 +1,7 @@ -ChangeStreamDocumentCollectionUUID | mongodb

Interface ChangeStreamDocumentCollectionUUID

interface ChangeStreamDocumentCollectionUUID {
    collectionUUID: Binary;
}

Hierarchy (view full)

Properties

collectionUUID +ChangeStreamDocumentCollectionUUID | mongodb

Interface ChangeStreamDocumentCollectionUUID

interface ChangeStreamDocumentCollectionUUID {
    collectionUUID: Binary;
}

Hierarchy (view full)

Properties

Properties

collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDocumentCommon.html b/docs/Next/interfaces/ChangeStreamDocumentCommon.html index 59c37363ae4..286be194fc7 100644 --- a/docs/Next/interfaces/ChangeStreamDocumentCommon.html +++ b/docs/Next/interfaces/ChangeStreamDocumentCommon.html @@ -1,22 +1,22 @@ -ChangeStreamDocumentCommon | mongodb

Interface ChangeStreamDocumentCommon

interface ChangeStreamDocumentCommon {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +ChangeStreamDocumentCommon | mongodb

Interface ChangeStreamDocumentCommon

interface ChangeStreamDocumentCommon {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDocumentKey.html b/docs/Next/interfaces/ChangeStreamDocumentKey.html index 027f1501bb8..99b01ad446c 100644 --- a/docs/Next/interfaces/ChangeStreamDocumentKey.html +++ b/docs/Next/interfaces/ChangeStreamDocumentKey.html @@ -1,4 +1,4 @@ -ChangeStreamDocumentKey | mongodb

Interface ChangeStreamDocumentKey<TSchema>

interface ChangeStreamDocumentKey<TSchema> {
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
}

Type Parameters

Hierarchy (view full)

Properties

documentKey +ChangeStreamDocumentKey | mongodb

Interface ChangeStreamDocumentKey<TSchema>

interface ChangeStreamDocumentKey<TSchema> {
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
}

Type Parameters

Hierarchy (view full)

Properties

Properties

documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. For sharded collections, this will contain all the components of the shard key

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDocumentOperationDescription.html b/docs/Next/interfaces/ChangeStreamDocumentOperationDescription.html index 0dd53bbdbbe..167780efcd9 100644 --- a/docs/Next/interfaces/ChangeStreamDocumentOperationDescription.html +++ b/docs/Next/interfaces/ChangeStreamDocumentOperationDescription.html @@ -1,5 +1,5 @@ -ChangeStreamDocumentOperationDescription | mongodb

Interface ChangeStreamDocumentOperationDescription

interface ChangeStreamDocumentOperationDescription {
    operationDescription?: Document;
}

Hierarchy (view full)

Properties

operationDescription? +ChangeStreamDocumentOperationDescription | mongodb

Interface ChangeStreamDocumentOperationDescription

interface ChangeStreamDocumentOperationDescription {
    operationDescription?: Document;
}

Hierarchy (view full)

Properties

operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDropDatabaseDocument.html b/docs/Next/interfaces/ChangeStreamDropDatabaseDocument.html index fa69af8b17a..7c1afa57566 100644 --- a/docs/Next/interfaces/ChangeStreamDropDatabaseDocument.html +++ b/docs/Next/interfaces/ChangeStreamDropDatabaseDocument.html @@ -1,5 +1,5 @@ ChangeStreamDropDatabaseDocument | mongodb

Interface ChangeStreamDropDatabaseDocument

interface ChangeStreamDropDatabaseDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    ns: {
        db: string;
    };
    operationType: "dropDatabase";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamDropDatabaseDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    ns: {
        db: string;
    };
    operationType: "dropDatabase";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id clusterTime? lsid? ns @@ -8,20 +8,20 @@ txnNumber?

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
ns: {
    db: string;
}

The database dropped

-
operationType: "dropDatabase"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

ns: {
    db: string;
}

The database dropped

+
operationType: "dropDatabase"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDropDocument.html b/docs/Next/interfaces/ChangeStreamDropDocument.html index 4fdd7f1056c..0de36d0142c 100644 --- a/docs/Next/interfaces/ChangeStreamDropDocument.html +++ b/docs/Next/interfaces/ChangeStreamDropDocument.html @@ -1,5 +1,5 @@ ChangeStreamDropDocument | mongodb

Interface ChangeStreamDropDocument

interface ChangeStreamDropDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "drop";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamDropDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "drop";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

Namespace the drop event occurred on

-
operationType: "drop"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

Namespace the drop event occurred on

+
operationType: "drop"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamDropIndexDocument.html b/docs/Next/interfaces/ChangeStreamDropIndexDocument.html index dde5fb0b59f..f3f439a63ea 100644 --- a/docs/Next/interfaces/ChangeStreamDropIndexDocument.html +++ b/docs/Next/interfaces/ChangeStreamDropIndexDocument.html @@ -1,6 +1,6 @@ ChangeStreamDropIndexDocument | mongodb

Interface ChangeStreamDropIndexDocument

Only present when the showExpandedEvents flag is enabled.

interface ChangeStreamDropIndexDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "dropIndexes";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamDropIndexDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "dropIndexes";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationDescription?: Document

An description of the operation.

+
operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
operationType: "dropIndexes"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "dropIndexes"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamInsertDocument.html b/docs/Next/interfaces/ChangeStreamInsertDocument.html index 43f05312a19..c4ab2e40146 100644 --- a/docs/Next/interfaces/ChangeStreamInsertDocument.html +++ b/docs/Next/interfaces/ChangeStreamInsertDocument.html @@ -1,5 +1,5 @@ ChangeStreamInsertDocument | mongodb

Interface ChangeStreamInsertDocument<TSchema>

interface ChangeStreamInsertDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "insert";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

_id +
interface ChangeStreamInsertDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "insert";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-
documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. +

documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. For sharded collections, this will contain all the components of the shard key

-
fullDocument: TSchema

This key will contain the document being inserted

-

The identifier for the session associated with the transaction. +

fullDocument: TSchema

This key will contain the document being inserted

+

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

Namespace the insert event occurred on

-
operationType: "insert"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

Namespace the insert event occurred on

+
operationType: "insert"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamInvalidateDocument.html b/docs/Next/interfaces/ChangeStreamInvalidateDocument.html index c957a44fd47..667927ea734 100644 --- a/docs/Next/interfaces/ChangeStreamInvalidateDocument.html +++ b/docs/Next/interfaces/ChangeStreamInvalidateDocument.html @@ -1,5 +1,5 @@ ChangeStreamInvalidateDocument | mongodb

Interface ChangeStreamInvalidateDocument

interface ChangeStreamInvalidateDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    operationType: "invalidate";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamInvalidateDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    lsid?: ServerSessionId;
    operationType: "invalidate";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationType: "invalidate"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "invalidate"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamNameSpace.html b/docs/Next/interfaces/ChangeStreamNameSpace.html index 4194ae39b43..54b71e545bd 100644 --- a/docs/Next/interfaces/ChangeStreamNameSpace.html +++ b/docs/Next/interfaces/ChangeStreamNameSpace.html @@ -1,3 +1,3 @@ -ChangeStreamNameSpace | mongodb

Interface ChangeStreamNameSpace

interface ChangeStreamNameSpace {
    coll: string;
    db: string;
}

Properties

coll +ChangeStreamNameSpace | mongodb

Interface ChangeStreamNameSpace

interface ChangeStreamNameSpace {
    coll: string;
    db: string;
}

Properties

Properties

coll: string
db: string
+

Properties

coll: string
db: string
diff --git a/docs/Next/interfaces/ChangeStreamOptions.html b/docs/Next/interfaces/ChangeStreamOptions.html index 1376534093d..ea6e484cd0b 100644 --- a/docs/Next/interfaces/ChangeStreamOptions.html +++ b/docs/Next/interfaces/ChangeStreamOptions.html @@ -1,5 +1,5 @@ ChangeStreamOptions | mongodb

Interface ChangeStreamOptions

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.

-
interface ChangeStreamOptions {
    allowDiskUse?: boolean;
    authdb?: string;
    batchSize?: number;
    bsonRegExp?: boolean;
    bypassDocumentValidation?: boolean;
    checkKeys?: boolean;
    collation?: CollationOptions;
    comment?: unknown;
    cursor?: Document;
    dbName?: string;
    enableUtf8Validation?: boolean;
    explain?: ExplainVerbosityLike | ExplainCommandOptions;
    fieldsAsRaw?: Document;
    fullDocument?: string;
    fullDocumentBeforeChange?: string;
    hint?: Hint;
    ignoreUndefined?: boolean;
    let?: Document;
    maxAwaitTimeMS?: number;
    maxTimeMS?: number;
    noResponse?: boolean;
    omitReadPreference?: boolean;
    out?: string;
    promoteBuffers?: boolean;
    promoteLongs?: boolean;
    promoteValues?: boolean;
    raw?: boolean;
    readConcern?: ReadConcernLike;
    readPreference?: ReadPreferenceLike;
    resumeAfter?: unknown;
    retryWrites?: boolean;
    serializeFunctions?: boolean;
    session?: ClientSession;
    showExpandedEvents?: boolean;
    startAfter?: unknown;
    startAtOperationTime?: Timestamp;
    timeoutMS?: number;
    useBigInt64?: boolean;
    willRetryWrite?: boolean;
}

Hierarchy

Properties

interface ChangeStreamOptions {
    allowDiskUse?: boolean;
    authdb?: string;
    batchSize?: number;
    bsonRegExp?: boolean;
    bypassDocumentValidation?: boolean;
    checkKeys?: boolean;
    collation?: CollationOptions;
    comment?: unknown;
    cursor?: Document;
    dbName?: string;
    enableUtf8Validation?: boolean;
    explain?: ExplainVerbosityLike | ExplainCommandOptions;
    fieldsAsRaw?: Document;
    fullDocument?: string;
    fullDocumentBeforeChange?: string;
    hint?: Hint;
    ignoreUndefined?: boolean;
    let?: Document;
    maxAwaitTimeMS?: number;
    maxTimeMS?: number;
    noResponse?: boolean;
    omitReadPreference?: boolean;
    out?: string;
    promoteBuffers?: boolean;
    promoteLongs?: boolean;
    promoteValues?: boolean;
    raw?: boolean;
    readConcern?: ReadConcernLike;
    readPreference?: ReadPreferenceLike;
    resumeAfter?: unknown;
    retryWrites?: boolean;
    serializeFunctions?: boolean;
    session?: ClientSession;
    showExpandedEvents?: boolean;
    startAfter?: unknown;
    startAtOperationTime?: Timestamp;
    timeoutMS?: number;
    useBigInt64?: boolean;
    willRetryWrite?: boolean;
}

Hierarchy

Properties

Properties

allowDiskUse?: boolean

allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 >).

authdb?: string
batchSize?: number

The number of documents to return per batch.

bsonRegExp?: boolean

return BSON regular expressions as BSONRegExp instances.

+
bsonRegExp?: boolean

return BSON regular expressions as BSONRegExp instances.

false

bypassDocumentValidation?: boolean

Allow driver to bypass schema validation.

checkKeys?: boolean

the serializer will check if keys are valid.

@@ -68,20 +68,20 @@ if the post-image for this event is available.

When set to 'required', the same behavior as 'whenAvailable' except that an error is raised if the post-image is not available.

-
fullDocumentBeforeChange?: string

Allowed values: 'whenAvailable', 'required', 'off'.

+
fullDocumentBeforeChange?: string

Allowed values: 'whenAvailable', 'required', 'off'.

The default is to not send a value, which is equivalent to 'off'.

When set to 'whenAvailable', configures the change stream to return the pre-image of the modified document for replace, update, and delete change events if it is available.

When set to 'required', the same behavior as 'whenAvailable' except that an error is raised if the pre-image is not available.

-
hint?: Hint

Add an index selection hint to an aggregation command

+
hint?: Hint

Add an index selection hint to an aggregation command

ignoreUndefined?: boolean

serialize will not emit undefined fields note that the driver sets this to false

true

let?: Document

Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0).

maxAwaitTimeMS?: number

The maximum amount of time for the server to wait on new documents to satisfy a change stream query.

-
maxTimeMS?: number

Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.

+
maxTimeMS?: number

Specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.

noResponse?: boolean
omitReadPreference?: boolean
out?: string
promoteBuffers?: boolean

when deserializing a Binary will return it as a node.js Buffer instance.

false

promoteLongs?: boolean

when deserializing a Long will fit it into a Number if it's smaller than 53 bits.

@@ -103,7 +103,7 @@
readPreference?: ReadPreferenceLike

The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest).

resumeAfter?: unknown

Allows you to start a changeStream after a specified event.

retryWrites?: boolean

Should retry failed writes

+
retryWrites?: boolean

Should retry failed writes

serializeFunctions?: boolean

serialize the javascript functions

false

session?: ClientSession

Specify ClientSession for this command

@@ -117,10 +117,10 @@
startAfter?: unknown

Similar to resumeAfter, but will allow you to start after an invalidated event.

+
startAfter?: unknown

Similar to resumeAfter, but will allow you to start after an invalidated event.

startAtOperationTime?: Timestamp

Will start the changeStream after the specified operationTime.

-
timeoutMS?: number

Specifies the time an operation will run until it throws a timeout error

+
startAtOperationTime?: Timestamp

Will start the changeStream after the specified operationTime.

+
timeoutMS?: number

Specifies the time an operation will run until it throws a timeout error

useBigInt64?: boolean

when deserializing a Long return as a BigInt.

false

willRetryWrite?: boolean
diff --git a/docs/Next/interfaces/ChangeStreamRefineCollectionShardKeyDocument.html b/docs/Next/interfaces/ChangeStreamRefineCollectionShardKeyDocument.html index 1b25e24a2a2..ec706424147 100644 --- a/docs/Next/interfaces/ChangeStreamRefineCollectionShardKeyDocument.html +++ b/docs/Next/interfaces/ChangeStreamRefineCollectionShardKeyDocument.html @@ -1,5 +1,5 @@ ChangeStreamRefineCollectionShardKeyDocument | mongodb

Interface ChangeStreamRefineCollectionShardKeyDocument

interface ChangeStreamRefineCollectionShardKeyDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "refineCollectionShardKey";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamRefineCollectionShardKeyDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "refineCollectionShardKey";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationDescription?: Document

An description of the operation.

+
operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
operationType: "refineCollectionShardKey"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "refineCollectionShardKey"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamRenameDocument.html b/docs/Next/interfaces/ChangeStreamRenameDocument.html index f4dac5c21c7..63f8b44d2c9 100644 --- a/docs/Next/interfaces/ChangeStreamRenameDocument.html +++ b/docs/Next/interfaces/ChangeStreamRenameDocument.html @@ -1,5 +1,5 @@ ChangeStreamRenameDocument | mongodb

Interface ChangeStreamRenameDocument

interface ChangeStreamRenameDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "rename";
    splitEvent?: ChangeStreamSplitEvent;
    to: {
        coll: string;
        db: string;
    };
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamRenameDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "rename";
    splitEvent?: ChangeStreamSplitEvent;
    to: {
        coll: string;
        db: string;
    };
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

The "from" namespace that the rename occurred on

-
operationType: "rename"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

The "from" namespace that the rename occurred on

+
operationType: "rename"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
to: {
    coll: string;
    db: string;
}

The new name for the ns.coll collection

-
txnNumber?: number

The transaction number. +

to: {
    coll: string;
    db: string;
}

The new name for the ns.coll collection

+
txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamReplaceDocument.html b/docs/Next/interfaces/ChangeStreamReplaceDocument.html index de7126d51ff..c6dfa43abed 100644 --- a/docs/Next/interfaces/ChangeStreamReplaceDocument.html +++ b/docs/Next/interfaces/ChangeStreamReplaceDocument.html @@ -1,5 +1,5 @@ ChangeStreamReplaceDocument | mongodb

Interface ChangeStreamReplaceDocument<TSchema>

interface ChangeStreamReplaceDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument: TSchema;
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "replace";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

_id +
interface ChangeStreamReplaceDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument: TSchema;
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "replace";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Type Parameters

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. +

documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. For sharded collections, this will contain all the components of the shard key

-
fullDocument: TSchema

The fullDocument of a replace event represents the document after the insert of the replacement document

-
fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the +

fullDocument: TSchema

The fullDocument of a replace event represents the document after the insert of the replacement document

+
fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the pre-image is available for the change event and either 'required' or 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option when creating the change stream. If 'whenAvailable' was specified but the pre-image is unavailable, this will be explicitly set to null.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

Namespace the replace event occurred on

-
operationType: "replace"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

Namespace the replace event occurred on

+
operationType: "replace"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamReshardCollectionDocument.html b/docs/Next/interfaces/ChangeStreamReshardCollectionDocument.html index 2fb66d3550b..fba005fe458 100644 --- a/docs/Next/interfaces/ChangeStreamReshardCollectionDocument.html +++ b/docs/Next/interfaces/ChangeStreamReshardCollectionDocument.html @@ -1,5 +1,5 @@ ChangeStreamReshardCollectionDocument | mongodb

Interface ChangeStreamReshardCollectionDocument

interface ChangeStreamReshardCollectionDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "reshardCollection";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamReshardCollectionDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "reshardCollection";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationDescription?: Document

An description of the operation.

+
operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
operationType: "reshardCollection"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "reshardCollection"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamShardCollectionDocument.html b/docs/Next/interfaces/ChangeStreamShardCollectionDocument.html index a635b56c078..8ae6d74631a 100644 --- a/docs/Next/interfaces/ChangeStreamShardCollectionDocument.html +++ b/docs/Next/interfaces/ChangeStreamShardCollectionDocument.html @@ -1,5 +1,5 @@ ChangeStreamShardCollectionDocument | mongodb

Interface ChangeStreamShardCollectionDocument

interface ChangeStreamShardCollectionDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "shardCollection";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

_id +
interface ChangeStreamShardCollectionDocument {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    lsid?: ServerSessionId;
    operationDescription?: Document;
    operationType: "shardCollection";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
}

Hierarchy (view full)

Properties

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-
operationDescription?: Document

An description of the operation.

+
operationDescription?: Document

An description of the operation.

Only present when the showExpandedEvents flag is enabled.

6.1.0

-
operationType: "shardCollection"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

operationType: "shardCollection"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
+
diff --git a/docs/Next/interfaces/ChangeStreamSplitEvent.html b/docs/Next/interfaces/ChangeStreamSplitEvent.html index 0a05c6725a8..7343a61ef77 100644 --- a/docs/Next/interfaces/ChangeStreamSplitEvent.html +++ b/docs/Next/interfaces/ChangeStreamSplitEvent.html @@ -1,5 +1,5 @@ -ChangeStreamSplitEvent | mongodb

Interface ChangeStreamSplitEvent

interface ChangeStreamSplitEvent {
    fragment: number;
    of: number;
}

Properties

fragment +ChangeStreamSplitEvent | mongodb

Interface ChangeStreamSplitEvent

interface ChangeStreamSplitEvent {
    fragment: number;
    of: number;
}

Properties

Properties

fragment: number

Which fragment of the change this is.

-
of: number

The total number of fragments.

-
+
of: number

The total number of fragments.

+
diff --git a/docs/Next/interfaces/ChangeStreamUpdateDocument.html b/docs/Next/interfaces/ChangeStreamUpdateDocument.html index 2f2e9b71170..1205a5a8abe 100644 --- a/docs/Next/interfaces/ChangeStreamUpdateDocument.html +++ b/docs/Next/interfaces/ChangeStreamUpdateDocument.html @@ -1,5 +1,5 @@ ChangeStreamUpdateDocument | mongodb

Interface ChangeStreamUpdateDocument<TSchema>

interface ChangeStreamUpdateDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument?: TSchema;
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "update";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
    updateDescription: UpdateDescription<TSchema>;
}

Type Parameters

Hierarchy (view full)

Properties

_id +
interface ChangeStreamUpdateDocument<TSchema> {
    _id: unknown;
    clusterTime?: Timestamp;
    collectionUUID: Binary;
    documentKey: {
        _id: InferIdType<TSchema>;
        [shardKey: string]: any;
    };
    fullDocument?: TSchema;
    fullDocumentBeforeChange?: TSchema;
    lsid?: ServerSessionId;
    ns: ChangeStreamNameSpace;
    operationType: "update";
    splitEvent?: ChangeStreamSplitEvent;
    txnNumber?: number;
    updateDescription: UpdateDescription<TSchema>;
}

Type Parameters

Hierarchy (view full)

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.

-
clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. +

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event. For events that happened as part of a multi-document transaction, the associated change stream notifications will have the same clusterTime value, namely the time when the transaction was committed. On a sharded cluster, events that occur on different shards can have the same clusterTime but be associated with different transactions or even not be associated with any transaction. To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.

-
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

+
collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.

Only present when the showExpandedEvents flag is enabled.

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.

6.1.0

-
documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. +

documentKey: {
    _id: InferIdType<TSchema>;
    [shardKey: string]: any;
}

For unsharded collections this contains a single field _id. For sharded collections, this will contain all the components of the shard key

-
fullDocument?: TSchema

This is only set if fullDocument is set to 'updateLookup' +

fullDocument?: TSchema

This is only set if fullDocument is set to 'updateLookup' Contains the point-in-time post-image of the modified document if the post-image is available and either 'required' or 'whenAvailable' was specified for the 'fullDocument' option when creating the change stream.

-
fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the +

fullDocumentBeforeChange?: TSchema

Contains the pre-image of the modified or deleted document if the pre-image is available for the change event and either 'required' or 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option when creating the change stream. If 'whenAvailable' was specified but the pre-image is unavailable, this will be explicitly set to null.

-

The identifier for the session associated with the transaction. +

The identifier for the session associated with the transaction. Only present if the operation is part of a multi-document transaction.

-

Namespace the update event occurred on

-
operationType: "update"

Describes the type of operation represented in this change notification

-

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent +

Namespace the update event occurred on

+
operationType: "update"

Describes the type of operation represented in this change notification

+

When the change stream's backing aggregation pipeline contains the $changeStreamSplitLargeEvent stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.

-
txnNumber?: number

The transaction number. +

txnNumber?: number

The transaction number. Only present if the operation is part of a multi-document transaction.

NOTE: txnNumber can be a Long if promoteLongs is set to false

-
updateDescription: UpdateDescription<TSchema>

Contains a description of updated and removed fields in this operation

-
+
updateDescription: UpdateDescription<TSchema>

Contains a description of updated and removed fields in this operation

+
diff --git a/docs/Next/interfaces/CloseOptions.html b/docs/Next/interfaces/CloseOptions.html index ef2d22c9f3e..18b456b8406 100644 --- a/docs/Next/interfaces/CloseOptions.html +++ b/docs/Next/interfaces/CloseOptions.html @@ -1,4 +1,4 @@ CloseOptions | mongodb

Interface CloseOptions

This interface is deprecated and will be removed in a future release as it is not used in the driver

-
interface CloseOptions {
    force?: boolean;
}

Properties

Properties

force?: boolean
+
interface CloseOptions {
    force?: boolean;
}

Properties

Properties

force?: boolean
diff --git a/docs/Next/interfaces/ConnectOptions.html b/docs/Next/interfaces/ConnectOptions.html index 5b0333f5d4c..e6eee52846a 100644 --- a/docs/Next/interfaces/ConnectOptions.html +++ b/docs/Next/interfaces/ConnectOptions.html @@ -1,2 +1,2 @@ -ConnectOptions | mongodb

Interface ConnectOptions

interface ConnectOptions {
    readPreference?: ReadPreference;
}

Properties

Properties

readPreference?: ReadPreference
+ConnectOptions | mongodb

Interface ConnectOptions

interface ConnectOptions {
    readPreference?: ReadPreference;
}

Properties

Properties

readPreference?: ReadPreference
diff --git a/docs/Next/interfaces/ConnectionPoolOptions.html b/docs/Next/interfaces/ConnectionPoolOptions.html index 8cf9958d468..b2a6028fb44 100644 --- a/docs/Next/interfaces/ConnectionPoolOptions.html +++ b/docs/Next/interfaces/ConnectionPoolOptions.html @@ -1,4 +1,4 @@ -ConnectionPoolOptions | mongodb

Interface ConnectionPoolOptions

interface ConnectionPoolOptions {
    allowPartialTrustChain?: boolean;
    ALPNProtocols?: Uint8Array | string[] | Uint8Array[];
    autoSelectFamily?: boolean;
    autoSelectFamilyAttemptTimeout?: number;
    ca?: string | Buffer | (string | Buffer)[];
    cancellationToken?: CancellationToken;
    cert?: string | Buffer | (string | Buffer)[];
    checkServerIdentity?: ((hostname: string, cert: PeerCertificate) => Error | undefined);
    ciphers?: string;
    compressors?: (
        | "none"
        | "snappy"
        | "zlib"
        | "zstd")[];
    connectTimeoutMS?: number;
    credentials?: MongoCredentials;
    crl?: string | Buffer | (string | Buffer)[];
    ecdhCurve?: string;
    family?: number;
    hints?: number;
    hostAddress: HostAddress;
    key?: string | Buffer | (string | Buffer | KeyObject)[];
    loadBalanced: boolean;
    localAddress?: string;
    localPort?: number;
    logicalSessionTimeoutMinutes?: number;
    lookup?: LookupFunction;
    maxConnecting: number;
    maxIdleTimeMS: number;
    maxPoolSize: number;
    metadata: ClientMetadata;
    minDHSize?: number;
    minPoolSize: number;
    monitorCommands: boolean;
    noDelay?: boolean;
    passphrase?: string;
    pfx?: string | Buffer | (string | Buffer | PxfObject)[];
    proxyHost?: string;
    proxyPassword?: string;
    proxyPort?: number;
    proxyUsername?: string;
    rejectUnauthorized?: boolean;
    secureContext?: SecureContext;
    secureProtocol?: string;
    serverApi?: ServerApi;
    servername?: string;
    session?: Buffer;
    socketTimeoutMS?: number;
    tls: boolean;
    waitQueueTimeoutMS: number;
}

Hierarchy

Properties

allowPartialTrustChain? +ConnectionPoolOptions | mongodb

Interface ConnectionPoolOptions

interface ConnectionPoolOptions {
    allowPartialTrustChain?: boolean;
    ALPNProtocols?: Uint8Array | string[] | Uint8Array[];
    autoSelectFamily?: boolean;
    autoSelectFamilyAttemptTimeout?: number;
    ca?: string | Buffer | (string | Buffer)[];
    cancellationToken?: CancellationToken;
    cert?: string | Buffer | (string | Buffer)[];
    checkServerIdentity?: ((hostname: string, cert: PeerCertificate) => Error | undefined);
    ciphers?: string;
    compressors?: (
        | "none"
        | "snappy"
        | "zlib"
        | "zstd")[];
    connectTimeoutMS?: number;
    credentials?: MongoCredentials;
    crl?: string | Buffer | (string | Buffer)[];
    ecdhCurve?: string;
    family?: number;
    hints?: number;
    hostAddress: HostAddress;
    key?: string | Buffer | (string | Buffer | KeyObject)[];
    loadBalanced: boolean;
    localAddress?: string;
    localPort?: number;
    logicalSessionTimeoutMinutes?: number;
    lookup?: LookupFunction;
    maxConnecting: number;
    maxIdleTimeMS: number;
    maxPoolSize: number;
    metadata: ClientMetadata;
    minDHSize?: number;
    minPoolSize: number;
    monitorCommands: boolean;
    noDelay?: boolean;
    passphrase?: string;
    pfx?: string | Buffer | (string | Buffer | PxfObject)[];
    proxyHost?: string;
    proxyPassword?: string;
    proxyPort?: number;
    proxyUsername?: string;
    rejectUnauthorized?: boolean;
    secureContext?: SecureContext;
    secureProtocol?: string;
    serverApi?: ServerApi;
    servername?: string;
    session?: Buffer;
    socketTimeoutMS?: number;
    tls: boolean;
    waitQueueTimeoutMS: number;
}

Hierarchy

Properties

allowPartialTrustChain? ALPNProtocols? autoSelectFamily? autoSelectFamilyAttemptTimeout? @@ -100,11 +100,11 @@ object.passphrase is optional. Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.

loadBalanced: boolean

If we are in load balancer mode.

-
localAddress?: string
localPort?: number
logicalSessionTimeoutMinutes?: number
lookup?: LookupFunction
maxConnecting: number

The maximum number of connections that may be in the process of being established concurrently by the connection pool.

-
maxIdleTimeMS: number

The maximum amount of time a connection should remain idle in the connection pool before being marked idle.

-
maxPoolSize: number

The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections.

-
metadata: ClientMetadata
minDHSize?: number
minPoolSize: number

The minimum number of connections that MUST exist at any moment in a single connection pool.

-
monitorCommands: boolean
noDelay?: boolean
passphrase?: string

Shared passphrase used for a single private key and/or a PFX.

+
localAddress?: string
localPort?: number
logicalSessionTimeoutMinutes?: number
lookup?: LookupFunction
maxConnecting: number

The maximum number of connections that may be in the process of being established concurrently by the connection pool.

+
maxIdleTimeMS: number

The maximum amount of time a connection should remain idle in the connection pool before being marked idle.

+
maxPoolSize: number

The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections.

+
metadata: ClientMetadata
minDHSize?: number
minPoolSize: number

The minimum number of connections that MUST exist at any moment in a single connection pool.

+
monitorCommands: boolean
noDelay?: boolean
passphrase?: string

Shared passphrase used for a single private key and/or a PFX.

pfx?: string | Buffer | (string | Buffer | PxfObject)[]

PFX or PKCS12 encoded private key and certificate chain. pfx is an alternative to providing key and cert individually. PFX is usually encrypted, if it is, passphrase will be used to decrypt it. Multiple @@ -131,4 +131,4 @@ interoperability. Default: none, see minVersion.

serverApi?: ServerApi
servername?: string
session?: Buffer

An optional Buffer instance containing a TLS session.

socketTimeoutMS?: number
tls: boolean
waitQueueTimeoutMS: number

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.

-
+
diff --git a/docs/Next/interfaces/DeleteManyModel.html b/docs/Next/interfaces/DeleteManyModel.html index 25b29c2b2af..354fe62bdbe 100644 --- a/docs/Next/interfaces/DeleteManyModel.html +++ b/docs/Next/interfaces/DeleteManyModel.html @@ -1,7 +1,7 @@ -DeleteManyModel | mongodb

Interface DeleteManyModel<TSchema>

interface DeleteManyModel<TSchema> {
    collation?: CollationOptions;
    filter: Filter<TSchema>;
    hint?: Hint;
}

Type Parameters

Properties

collation? +DeleteManyModel | mongodb

Interface DeleteManyModel<TSchema>

interface DeleteManyModel<TSchema> {
    collation?: CollationOptions;
    filter: Filter<TSchema>;
    hint?: Hint;
}

Type Parameters

Properties

collation?: CollationOptions

Specifies a collation.

-
filter: Filter<TSchema>

The filter to limit the deleted documents.

-
hint?: Hint

The index to use. If specified, then the query system will only consider plans using the hinted index.

-
+
filter: Filter<TSchema>

The filter to limit the deleted documents.

+
hint?: Hint

The index to use. If specified, then the query system will only consider plans using the hinted index.

+
diff --git a/docs/Next/interfaces/DeleteOneModel.html b/docs/Next/interfaces/DeleteOneModel.html index a51f24688e9..421b16692f6 100644 --- a/docs/Next/interfaces/DeleteOneModel.html +++ b/docs/Next/interfaces/DeleteOneModel.html @@ -1,7 +1,7 @@ -DeleteOneModel | mongodb

Interface DeleteOneModel<TSchema>

interface DeleteOneModel<TSchema> {
    collation?: CollationOptions;
    filter: Filter<TSchema>;
    hint?: Hint;
}

Type Parameters

Properties

collation? +DeleteOneModel | mongodb

Interface DeleteOneModel<TSchema>

interface DeleteOneModel<TSchema> {
    collation?: CollationOptions;
    filter: Filter<TSchema>;
    hint?: Hint;
}

Type Parameters

Properties

collation?: CollationOptions

Specifies a collation.

-
filter: Filter<TSchema>

The filter to limit the deleted documents.

-
hint?: Hint

The index to use. If specified, then the query system will only consider plans using the hinted index.

-
+
filter: Filter<TSchema>

The filter to limit the deleted documents.

+
hint?: Hint

The index to use. If specified, then the query system will only consider plans using the hinted index.

+
diff --git a/docs/Next/interfaces/EndSessionOptions.html b/docs/Next/interfaces/EndSessionOptions.html index fc00b05088a..abb46d2c3f2 100644 --- a/docs/Next/interfaces/EndSessionOptions.html +++ b/docs/Next/interfaces/EndSessionOptions.html @@ -1,5 +1,5 @@ -EndSessionOptions | mongodb

Interface EndSessionOptions

interface EndSessionOptions {
    force?: boolean;
    forceClear?: boolean;
    timeoutMS?: number;
}

Properties

force? +EndSessionOptions | mongodb

Interface EndSessionOptions

interface EndSessionOptions {
    force?: boolean;
    forceClear?: boolean;
    timeoutMS?: number;
}

Properties

force?: boolean
forceClear?: boolean
timeoutMS?: number

Specifies the time an operation will run until it throws a timeout error

-
+

Properties

force?: boolean
forceClear?: boolean
timeoutMS?: number

Specifies the time an operation will run until it throws a timeout error

+
diff --git a/docs/Next/interfaces/ErrorDescription.html b/docs/Next/interfaces/ErrorDescription.html index dac57c05541..795d8632b4c 100644 --- a/docs/Next/interfaces/ErrorDescription.html +++ b/docs/Next/interfaces/ErrorDescription.html @@ -1,6 +1,6 @@ -ErrorDescription | mongodb

Interface ErrorDescription

interface ErrorDescription {
    $err?: string;
    errInfo?: Document;
    errmsg?: string;
    errorLabels?: string[];
    message?: string;
}

Hierarchy (view full)

Properties

$err? +ErrorDescription | mongodb

Interface ErrorDescription

interface ErrorDescription {
    $err?: string;
    errInfo?: Document;
    errmsg?: string;
    errorLabels?: string[];
    message?: string;
}

Hierarchy (view full)

Properties

$err?: string
errInfo?: Document
errmsg?: string
errorLabels?: string[]
message?: string
+

Properties

$err?: string
errInfo?: Document
errmsg?: string
errorLabels?: string[]
message?: string
diff --git a/docs/Next/interfaces/InsertOneModel.html b/docs/Next/interfaces/InsertOneModel.html index f96323d902a..b47cca175f5 100644 --- a/docs/Next/interfaces/InsertOneModel.html +++ b/docs/Next/interfaces/InsertOneModel.html @@ -1,3 +1,3 @@ -InsertOneModel | mongodb

Interface InsertOneModel<TSchema>

interface InsertOneModel<TSchema> {
    document: OptionalId<TSchema>;
}

Type Parameters

Properties

document +InsertOneModel | mongodb

Interface InsertOneModel<TSchema>

interface InsertOneModel<TSchema> {
    document: OptionalId<TSchema>;
}

Type Parameters

Properties

Properties

document: OptionalId<TSchema>

The document to insert.

-
+
diff --git a/docs/Next/interfaces/MongoNetworkErrorOptions.html b/docs/Next/interfaces/MongoNetworkErrorOptions.html index 7c9532b3d9f..ff6a5b33b20 100644 --- a/docs/Next/interfaces/MongoNetworkErrorOptions.html +++ b/docs/Next/interfaces/MongoNetworkErrorOptions.html @@ -1,4 +1,4 @@ -MongoNetworkErrorOptions | mongodb

Interface MongoNetworkErrorOptions

interface MongoNetworkErrorOptions {
    beforeHandshake?: boolean;
    cause?: Error;
}

Properties

beforeHandshake? +MongoNetworkErrorOptions | mongodb

Interface MongoNetworkErrorOptions

interface MongoNetworkErrorOptions {
    beforeHandshake?: boolean;
    cause?: Error;
}

Properties

beforeHandshake?: boolean

Indicates the timeout happened before a connection handshake completed

-
cause?: Error
+
cause?: Error
diff --git a/docs/Next/interfaces/MongoOptions.html b/docs/Next/interfaces/MongoOptions.html index f134ae78897..4b2e0dc1536 100644 --- a/docs/Next/interfaces/MongoOptions.html +++ b/docs/Next/interfaces/MongoOptions.html @@ -11,7 +11,7 @@
  • DNS SRV records and TXT records
  • Not all options may be present after client construction as some are obtained from asynchronous operations.

    -
    interface MongoOptions {
        allowPartialTrustChain?: boolean;
        ALPNProtocols?: Uint8Array | string[] | Uint8Array[];
        appName?: string;
        autoEncryption: AutoEncryptionOptions;
        autoSelectFamily?: boolean;
        autoSelectFamilyAttemptTimeout?: number;
        ca?: string | Buffer | (string | Buffer)[];
        cert?: string | Buffer | (string | Buffer)[];
        checkServerIdentity?: ((hostname: string, cert: PeerCertificate) => Error | undefined);
        ciphers?: string;
        compressors: (
            | "none"
            | "snappy"
            | "zlib"
            | "zstd")[];
        connectTimeoutMS: number;
        credentials?: MongoCredentials;
        crl?: string | Buffer | (string | Buffer)[];
        dbName: string;
        directConnection: boolean;
        driverInfo: DriverInfo;
        ecdhCurve?: string;
        family?: number;
        forceServerObjectId: boolean;
        heartbeatFrequencyMS: number;
        hints?: number;
        hosts: HostAddress[];
        key?: string | Buffer | (string | Buffer | KeyObject)[];
        loadBalanced: boolean;
        localAddress?: string;
        localPort?: number;
        localThresholdMS: number;
        lookup?: LookupFunction;
        maxConnecting: number;
        maxIdleTimeMS: number;
        maxPoolSize: number;
        metadata: ClientMetadata;
        minDHSize?: number;
        minHeartbeatFrequencyMS: number;
        minPoolSize: number;
        monitorCommands: boolean;
        noDelay: boolean;
        passphrase?: string;
        pfx?: string | Buffer | (string | Buffer | PxfObject)[];
        pkFactory: PkFactory;
        proxyHost?: string;
        proxyPassword?: string;
        proxyPort?: number;
        proxyUsername?: string;
        raw: boolean;
        readConcern: ReadConcern;
        readPreference: ReadPreference;
        rejectUnauthorized?: boolean;
        replicaSet: string;
        retryReads: boolean;
        retryWrites: boolean;
        secureContext?: SecureContext;
        secureProtocol?: string;
        serverApi: ServerApi;
        serverMonitoringMode: ServerMonitoringMode;
        servername?: string;
        serverSelectionTimeoutMS: number;
        session?: Buffer;
        socketTimeoutMS: number;
        srvHost?: string;
        srvMaxHosts: number;
        srvServiceName: string;
        timeoutMS?: number;
        tls: boolean;
        tlsAllowInvalidCertificates: boolean;
        tlsAllowInvalidHostnames: boolean;
        tlsCAFile?: string;
        tlsCertificateKeyFile?: string;
        tlsCRLFile?: string;
        tlsInsecure: boolean;
        waitQueueTimeoutMS: number;
        writeConcern: WriteConcern;
        zlibCompressionLevel:
            | 0
            | 1
            | 2
            | 3
            | 4
            | 5
            | 6
            | 7
            | 8
            | 9;
    }

    Hierarchy (view full)

    • 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
      • MongoOptions

    Properties

    interface MongoOptions {
        allowPartialTrustChain?: boolean;
        ALPNProtocols?: Uint8Array | string[] | Uint8Array[];
        appName?: string;
        autoEncryption: AutoEncryptionOptions;
        autoSelectFamily?: boolean;
        autoSelectFamilyAttemptTimeout?: number;
        ca?: string | Buffer | (string | Buffer)[];
        cert?: string | Buffer | (string | Buffer)[];
        checkServerIdentity?: ((hostname: string, cert: PeerCertificate) => Error | undefined);
        ciphers?: string;
        compressors: (
            | "none"
            | "snappy"
            | "zlib"
            | "zstd")[];
        connectTimeoutMS: number;
        credentials?: MongoCredentials;
        crl?: string | Buffer | (string | Buffer)[];
        dbName: string;
        directConnection: boolean;
        driverInfo: DriverInfo;
        ecdhCurve?: string;
        family?: number;
        forceServerObjectId: boolean;
        heartbeatFrequencyMS: number;
        hints?: number;
        hosts: HostAddress[];
        key?: string | Buffer | (string | Buffer | KeyObject)[];
        loadBalanced: boolean;
        localAddress?: string;
        localPort?: number;
        localThresholdMS: number;
        lookup?: LookupFunction;
        maxConnecting: number;
        maxIdleTimeMS: number;
        maxPoolSize: number;
        metadata: ClientMetadata;
        minDHSize?: number;
        minHeartbeatFrequencyMS: number;
        minPoolSize: number;
        monitorCommands: boolean;
        noDelay: boolean;
        passphrase?: string;
        pfx?: string | Buffer | (string | Buffer | PxfObject)[];
        pkFactory: PkFactory;
        proxyHost?: string;
        proxyPassword?: string;
        proxyPort?: number;
        proxyUsername?: string;
        raw: boolean;
        readConcern: ReadConcern;
        readPreference: ReadPreference;
        rejectUnauthorized?: boolean;
        replicaSet: string;
        retryReads: boolean;
        retryWrites: boolean;
        secureContext?: SecureContext;
        secureProtocol?: string;
        serverApi: ServerApi;
        serverMonitoringMode: ServerMonitoringMode;
        servername?: string;
        serverSelectionTimeoutMS: number;
        session?: Buffer;
        socketTimeoutMS: number;
        srvHost?: string;
        srvMaxHosts: number;
        srvServiceName: string;
        timeoutMS?: number;
        tls: boolean;
        tlsAllowInvalidCertificates: boolean;
        tlsAllowInvalidHostnames: boolean;
        tlsCAFile?: string;
        tlsCertificateKeyFile?: string;
        tlsCRLFile?: string;
        tlsInsecure: boolean;
        waitQueueTimeoutMS: number;
        writeConcern: WriteConcern;
        zlibCompressionLevel:
            | 0
            | 1
            | 2
            | 3
            | 4
            | 5
            | 6
            | 7
            | 8
            | 9;
    }

    Hierarchy (view full)

    • 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
      • MongoOptions

    Properties

    v22.9.0, v20.18.0

    ALPNProtocols?: Uint8Array | string[] | Uint8Array[]

    An array of strings or a Buffer naming possible ALPN protocols. (Protocols should be ordered by their priority.)

    -
    appName?: string
    autoEncryption: AutoEncryptionOptions

    Optionally enable in-use auto encryption

    +
    appName?: string
    autoEncryption: AutoEncryptionOptions

    Optionally enable in-use auto encryption

    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 (see libmongocrypt: Auto Encryption Allow-List). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts.

    Automatic encryption requires the authenticated user to have the listCollections privilege action.

    @@ -134,10 +134,10 @@ information, see modifying the default cipher suite. Permitted ciphers can be obtained via tls.getCiphers(). Cipher names must be uppercased in order for OpenSSL to accept them.

    -
    compressors: (
        | "none"
        | "snappy"
        | "zlib"
        | "zstd")[]
    connectTimeoutMS: number

    The time in milliseconds to attempt a connection before timing out.

    -
    credentials?: MongoCredentials
    crl?: string | Buffer | (string | Buffer)[]

    PEM formatted CRLs (Certificate Revocation Lists).

    -
    dbName: string
    directConnection: boolean

    Allow a driver to force a Single topology type with a connection string containing one host

    -
    driverInfo: DriverInfo

    Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver

    +
    compressors: (
        | "none"
        | "snappy"
        | "zlib"
        | "zstd")[]
    connectTimeoutMS: number

    The time in milliseconds to attempt a connection before timing out.

    +
    credentials?: MongoCredentials
    crl?: string | Buffer | (string | Buffer)[]

    PEM formatted CRLs (Certificate Revocation Lists).

    +
    dbName: string
    directConnection: boolean

    Allow a driver to force a Single topology type with a connection string containing one host

    +
    driverInfo: DriverInfo

    Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver

    ecdhCurve?: string

    A string describing a named curve or a colon separated list of curve NIDs or names, for example P-521:P-384:P-256, to use for ECDH key agreement. Set to auto to select the curve automatically. Use @@ -147,7 +147,7 @@ tls.DEFAULT_ECDH_CURVE.

    family?: number
    forceServerObjectId: boolean

    Force server to assign _id values instead of driver

    heartbeatFrequencyMS: number

    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.

    -
    hints?: number
    hosts: HostAddress[]
    key?: string | Buffer | (string | Buffer | KeyObject)[]

    Private keys in PEM format. PEM allows the option of private keys +

    hints?: number
    hosts: HostAddress[]
    key?: string | Buffer | (string | Buffer | KeyObject)[]

    Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with options.passphrase. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, @@ -155,11 +155,11 @@ passphrase: ]}. The object form can only occur in an array. object.passphrase is optional. Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.

    -
    loadBalanced: boolean
    localAddress?: string
    localPort?: number
    localThresholdMS: number

    The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances.

    +
    loadBalanced: boolean
    localAddress?: string
    localPort?: number
    localThresholdMS: number

    The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances.

    lookup?: LookupFunction
    maxConnecting: number

    The maximum number of connections that may be in the process of being established concurrently by the connection pool.

    maxIdleTimeMS: number

    The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed.

    maxPoolSize: number

    The maximum number of connections in the connection pool.

    -
    metadata: ClientMetadata
    minDHSize?: number
    minHeartbeatFrequencyMS: number

    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.

    +
    metadata: ClientMetadata
    minDHSize?: number
    minHeartbeatFrequencyMS: number

    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.

    minPoolSize: number

    The minimum number of connections in the connection pool.

    monitorCommands: boolean

    Enable command monitoring for this client

    noDelay: boolean

    TCP Connection no delay

    @@ -173,7 +173,7 @@ object.passphrase is optional. Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.

    pkFactory: PkFactory

    A primary key factory function for generation of custom _id keys

    -
    proxyHost?: string
    proxyPassword?: string
    proxyPort?: number
    proxyUsername?: string
    raw: boolean

    Enabling the raw option will return a Node.js Buffer +

    proxyHost?: string
    proxyPassword?: string
    proxyPort?: number
    proxyUsername?: string
    raw: boolean

    Enabling the raw option will return a Node.js Buffer which is allocated using allocUnsafe API. See this section from the Node.js Docs here for more detail about what "unsafe" refers to in this context. @@ -184,7 +184,7 @@

    Please note there is a known limitation where this option cannot be used at the MongoClient level (see NODE-3946). It does correctly work at Db, Collection, and per operation the same as other BSON options work.

    -
    readConcern: ReadConcern
    readPreference: ReadPreference
    rejectUnauthorized?: boolean

    If true the server will reject any connection which is not +

    readConcern: ReadConcern
    readPreference: ReadPreference
    rejectUnauthorized?: boolean

    If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true.

    true
    @@ -203,14 +203,14 @@ 
    serverApi: ServerApi
    serverMonitoringMode: ServerMonitoringMode
    servername?: string
    serverSelectionTimeoutMS: number

    Specifies how long (in milliseconds) to block for server selection before throwing an exception.

    +
    serverApi: ServerApi
    serverMonitoringMode: ServerMonitoringMode
    servername?: string
    serverSelectionTimeoutMS: number

    Specifies how long (in milliseconds) to block for server selection before throwing an exception.

    session?: Buffer

    An optional Buffer instance containing a TLS session.

    socketTimeoutMS: number

    The time in milliseconds to attempt a send or receive on a socket before the attempt times out.

    -
    srvHost?: string
    srvMaxHosts: number

    The maximum number of hosts to connect to when using an srv connection string, a setting of 0 means unlimited hosts

    +
    srvHost?: string
    srvMaxHosts: number

    The maximum number of hosts to connect to when using an srv connection string, a setting of 0 means unlimited hosts

    srvServiceName: string

    Modifies the srv URI to look like:

    _{srvServiceName}._tcp.{hostname}.{domainname}

    Querying this DNS URI is expected to respond with SRV records

    -
    timeoutMS?: number
    tls: boolean

    NOTE ABOUT TLS Options

    If tls is provided as an option, it is equivalent to setting the ssl option.

    +
    timeoutMS?: number
    tls: boolean

    NOTE ABOUT TLS Options

    If tls is provided as an option, it is equivalent to setting the ssl option.

    NodeJS native TLS options are passed through to the socket and retain their original types.

    @@ -273,9 +273,9 @@