rename
Event事件
On this page本页内容
Summary摘要
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. Some events don't relate to a transaction at all.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. dropTarget | UUID | |
operationDescription. to | document | |
operationDescription. to.coll | document | |
operationDescription. to.db | document | |
operationType | string | rename for these change events. rename 。 |
to | document | |
to.coll | document | |
to.db | 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条目中获取的时间戳。 |
Behavior行为
Expanded Event Information扩展的事件信息
Changed in version 6.0.6.0版更改。
Starting in MongoDB 6.0, when the showExpandedEvents option is set to 从MongoDB 6.0开始,当更改流的true
for the change stream, the rename
event includes an operationDescription
document. showExpandedEvents
选项设置为true
时,rename
事件包括一个operationDescription
文档。This document provides a 此文档提供了一个显示更改后的数据库和集合的to
field showing the changed database and collection and a dropTarget
field indicating whether the rename
operation removed the collection before the rename.to
字段,以及一个指示rename
操作是否在重命名前删除了集合的dropTarget
字段。
Example实例
The following example illustrates a 以下示例说明了rename
event:rename
事件:
{
"_id": { <Resume Token> },
"operationType": "rename",
"clusterTime": <Timestamp>,
"wallTime": <ISODate>,
"ns": {
"db": "engineering",
"coll": "users"
},
"to": {
"db": "engineering",
"coll": "people"
},
"operationDescription": {
"to": {
"db": "engineering",
"coll": "people"
}
}
}
A rename
event leads to an invalidate event for change streams opened against its ns
collection or to
collection.rename
事件会导致针对其ns
集合或to
集合打开的更改流的无效事件。