Interface ChangeStreamInsertDocument<TSchema>

Type Parameters

Hierarchy

Properties

_id: unknown

The id functions as an opaque token for use when resuming an interrupted change stream.id的作用是在恢复中断的变更流时使用的不透明令牌。

clusterTime?: Timestamp

The timestamp from the oplog entry associated with the event.与事件关联的oplog条目中的时间戳。 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.对于作为多文档事务一部分发生的事件,关联的更改流通知将具有相同的clusterTime值,即提交事务的时间。 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.在分片集群上,发生在不同分片上的事件可以具有相同的clusterTime,但与不同的事务关联,甚至不与任何事务关联。 To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document.要识别单个事务的事件,可以在变更流事件文档中使用lsid和txnNumber的组合。

collectionUUID: Binary

The UUID (Binary subtype 4) of the collection that the operation was performed on.对其执行操作的集合的UUID(二进制子类型4)。

Only present when the showExpandedEvents flag is enabled.仅在启用showExpandedEvents标志时出现。

NOTE: collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers flag is enabled.如果promoteBuffers标志已启用,collectionUUID将被转换为NodeJS缓冲区。

Since Server Version

6.1.0

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

For unsharded collections this contains a single field _id.对于未排序的集合,它包含一个字段_id For sharded collections, this will contain all the components of the shard key对于分片集合,它将包含分片键的所有组件

Type declaration

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 stage, events larger than 16MB will be split into multiple events and contain the following information about which fragment the current event is.当变更流的后台聚合管道包含$changeStreamSplitTargetEvent阶段时,大于16MB的事件将被拆分为多个事件,并包含以下关于当前事件是哪个片段的信息。

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如果promoteLongs设置为falsetxnNumber可以是Long

Generated using TypeDoc