Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ChangeStreamUpdateDocument<TSchema>

Type parameters

Hierarchy

Index

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. 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> }

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

Type declaration

fullDocument?: TSchema

This is only set if fullDocument is set to 'updateLookup' The fullDocument document represents the most current majority-committed version of the updated document. The fullDocument document may vary from the document at the time of the update operation depending on the number of interleaving majority-committed operations that occur between the update operation and the document lookup.

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 occured on

operationType: "update"

Describes the type of operation represented in this change notification

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

Generated using TypeDoc