invalidate
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. clusterTime 的事件可能并不都与同一事务相关。lsid and txnNumber in the change stream event document. lsid 和txnNumber 的组合。 |
operationType | string | invalidate for these change events. invalidate 值。 |
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 illustrates an 以下示例说明了一个invalidate
event:invalidate
事件:
{
"_id": { <Resume Token> },
"operationType": "invalidate",
"clusterTime": <Timestamp>,
"wallTime": <ISODate>
}
Change streams opened on collections raise an 当发生影响监视的集合的drop、rename或dropDatabase操作时,在集合上打开的更改流会引发invalidate
event when a drop, rename, or dropDatabase operation occurs that affects the watched collection.invalidate
事件。
Change streams opened on databases raise an 当发生影响监视数据库的invalidate
event when a dropDatabase event occurs that affects the watched database.dropDatabase
事件时,在数据库上打开的更改流会引发invalidate
事件。
invalidate
events close the change stream cursor.事件关闭更改流游标。
You cannot use 在无效事件(例如,集合丢弃或重命名)关闭更改流后,不能使用resumeAfter
to resume a change stream after an invalidate event (for example, a collection drop or rename) closes the stream. resumeAfter
恢复更改流。Starting in MongoDB 4.2, you can use startAfter to start a new change stream after an invalidate event.从MongoDB 4.2开始,您可以使用startAfter
在invalidate
事件后启动一个新的更改流。
modify
Event →