shardCollection
事件
摘要
描述
字段 | 类型 | 描述 | |||
---|---|---|---|---|---|
_id | 文档 | ABSON 对象,用作更改流事件的标识符。此值用作恢复更改流时的
以下是一个通过 | |||
clusterTime | 时间戳 | ||||
collectionUUID | UUID | UUID用于标识发生更改的集合。 新版本6.0. | |||
lsid | 文档 | 与事务相关的会话的标识符。 仅在操作是多文档事务的一部分时存在。 | |||
ns | 文档 | 受事件影响的名字空间(数据库和/或集合)。 | |||
ns.coll | 字符串 | 事件发生的集合名称。 | |||
ns.db | 字符串 | 事件发生的数据库名称。 | |||
operationDescription | 文档 | ||||
operationDescription. numInitialChunks | 长整型 | 在 新版本6.0. | |||
operationDescription. presplitHashedZones | 布尔型 | 表示当集合成为分片时,分片块是否已根据区域预先分割。 新版本6.0. | |||
operationDescription. shardKey | 文档 | 发生更改的集合的分片键。 新版本6.0. | |||
operationDescription. unique | 布尔型 | 如果集合使用唯一分片键进行分片,则此值将为true。 新版本6.0. | |||
operationType | 字符串 | 更改通知报告的操作类型。 对于这些更改事件,返回值为 | |||
txnNumber | NumberLong | ||||
wallTime | 数据库操作的服务器日期和时间。 新版本6.0. |
示例
以下示例展示了 shardCollection
事件
{ "_id": { <ResumeToken> }, "operationType": "shardCollection", "clusterTime": Timestamp({ t: 1654894852, i: 52 }), "collectionUUID": UUID("98046a1a-b649-4e5b-9c75-67594221ce19"), "wallTime": ISODate("2022-06-10T21:00:52.854Z"), "ns": { "db": "test", "coll": "authors" }, "operationDescription": { "shardKey": { "age": "hashed" }, "unique": false, "numInitialChunks": Long("0"), "presplitHashedZones": false } }