dropIndexes
On this page本页内容
Synopsis提要
- dropIndexes
- New in version 6.0.6.0版新增。- A当从集合中删除索引并且更改流的- dropIndexesevent occurs when an index is dropped from the collection and the change stream has the showExpandedEvents option set to- true.- showExpandedEvents选项设置为- true时,会发生- dropIndexes事件。
Descriptions说明
| _id | Document | resumeTokenfor theresumeAfterparameter when resuming a change stream.resumeAfter参数的resumeToken。_idobject has the following form:_id对象具有以下形式:{_datatype 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)。_datatypes._data类型的完整列表。resumeToken, see Resume a Change Stream.resumeToken恢复更改流的示例,请参阅恢复更改流。 | 
| clusterTime | Timestamp | clusterTimevalue: the time when the transaction was committed.clusterTime值:事务提交的时间。clusterTimemay not all relate to the same transaction.clusterTime的事件可能并不都与同一事务相关。lsidandtxnNumberin the change stream event document.lsid和txnNumber的组合。 | 
| collectionUUID | UUID | UUID | 
| lsid | document | |
| ns | document | |
| ns.db | string | |
| ns.coll | string | |
| operationDescription | document | |
| operationDescription.indexes | array | |
| operationType | string | dropIndexesfor these change events.dropIndexes值。 | 
| txnNumber | NumberLong | lsid一起,是一个有助于唯一识别事务的数字。 | 
| wallTime | ISODate | wallTimediffers fromclusterTimein thatclusterTimeis a timestamp taken from the oplog entry associated with the database operation event.wallTime与clusterTime的不同之处在于,clusterTime是从与数据库操作事件关联的oplog条目中获取的时间戳。 | 
Example实例
The following example shows a 以下示例显示了一个dropIndexes event:dropIndexes事件:
{
"_id": { <ResumeToken> },
"operationType": "dropIndexes",
"clusterTime": <Timestamp>
"collectionUUID": <uuid>,
"wallTime": <isodate>,
"ns": {
"db": "test",
"coll": "authors" },
"operationDescription": {
"indexes": [
{ "v": 2, "key": { "name": 1 }, "name": "name_1" }
]
}
}
←  dropDatabase insert →