创建事件
摘要
create
新版本6.0.
在监视数据库上创建集合时发生
create
事件,并且变更流具有 showExpandedEvents 选项设置为true
。showExpandedEvents 选项设置为true
。
描述
字段 | 类型 | 描述 | |||
---|---|---|---|---|---|
_id | 文档 | 一个作为变更流事件标识符的 BSON 对象。该值用作在恢复变更流时
有关通过 | |||
clusterTime | 时间戳 | ||||
collectionUUID | UUID | 如果更改发生在集合上, 新版本6.0. | |||
lsid | document | 与事务相关联的会话的标识符。 仅在操作是多文档事务的一部分时才出现。 | |||
ns | document | 受事件影响的作用域(数据库和/或集合)。 | |||
ns.coll | string | 事件发生时的集合名称。 | |||
ns.db | string | 事件发生时的数据库名称。 | |||
operationDescription | document | ||||
operationDescription. idIndex | document | 新集合的默认 新版本6.0. | |||
operationType | string | 更改通知报告的操作类型。 对于这些更改事件,返回值为 | |||
txnNumber | NumberLong | ||||
wallTime | 数据库操作的数据库服务器日期和时间。 新版本6.0. |
示例
以下示例展示了一个 create
事件
{ "_id": { <ResumeToken> }, "operationType": "create", "clusterTime": Timestamp({ t: 1654894547, i: 24 }), "collectionUUID": UUID("98046a1a-b649-4e5b-9c75-67594221ce19"), "wallTime": ISODate("2022-06-10T20:55:47.947Z"), "ns": { "db": "test", "coll": "names" }, "operationDescription": { "idIndex": { "v": 2, "key": { _id: 1 }, "name": "_id_" } } }