modify
Event
On this page本页内容
Summary摘要
modify
New in version 6.0.6.0版新增。A修改集合时会发生modify
event occurs when a collection is modified, such as when thecollMod
command adds or remove options from a collection or view.modify
事件,例如collMod
命令在集合或视图中添加或删除选项时。This event is received only if the change stream has the showExpandedEvents option set to只有当更改流的true
.showExpandedEvents
选项设置为true
时,才会接收到此事件。
Description描述
_id | Document | resumeToken for the resumeAfter parameter when resuming a change stream. resumeAfter 参数的resumeToken 。_id object has the following form:_id 对象具有以下形式:
{ _data type depends on the MongoDB versions and, in some cases, the feature compatibility version (fCV) at the time of the change stream's opening or resumption. _data 类型取决于MongoDB版本,在某些情况下,还取决于更改流打开或恢复时的功能兼容性版本(fCV)。_data types._data 类型的完整列表。resumeToken , see Resume a Change Stream. resumeToken 恢复更改流的示例,请参阅恢复更改流。 |
clusterTime | Timestamp | clusterTime value: the time when the transaction was committed.clusterTime 值:事务提交的时间。clusterTime may not all relate to the same transaction. clusterTime 的事件可能并不都与同一事务相关。lsid and txnNumber in the change stream event document. lsid 和txnNumber 的组合。 |
collectionUUID | UUID | UUID |
lsid | document | |
ns | document | |
ns.db | string | |
ns.coll | string | |
operationDescription | document | |
operationDescription. index | document | |
operationDescription. indexes | array | |
operationType | string | modify for these change events. modify 值。 |
stateBeforeChange | document | |
stateBeforeChange. collectionOptions | document | |
stateBeforeChange. indexOptions | document | |
txnNumber | NumberLong | lsid 一起,是一个有助于唯一识别事务的数字。 |
wallTime | ISODate | wallTime differs from clusterTime in that clusterTime is a timestamp taken from the oplog entry associated with the database operation event. wallTime 与clusterTime 的不同之处在于,clusterTime 是从与数据库操作事件关联的oplog条目中获取的时间戳。 |
Example实例
The following example shows a 以下示例显示了一个modify
event:modify
事件:
{
"_id": { <ResumeToken> },
"operationType": "modify",
"clusterTime": Timestamp({ t: 1654878543, i: 1 }),
"collectionUUID": UUID("47d6baac-eeaa-488b-98ae-893f3abaaf25"),
"wallTime": ISODate("2022-06-10T16:29:03.704Z"),
"ns": {
"db": "test",
"coll": "authors" },
"operationDescription": {
"index": {
"name": "age_1",
"hidden": true
}
},
"stateBeforeChange": {
"collectionOptions": {
"uuid": UUID("47d6baac-eeaa-488b-98ae-893f3abaaf25")
},
"indexOptions": {
"hidden": false
}
}
}