appendOplogNote
定义
appendOplogNote
向 oplog 写入一个非操作条目。
兼容性
此命令可用于以下环境中托管的部署:
MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
You can only run the appendOplogNote
command on the admin
database.
The command has this syntax:
db.adminCommand( { appendOplogNote: 1, data: <document> } )
命令字段
字段 | 类型 | 说明 |
---|---|---|
| any | Set to any value. |
| 文档 | The document to append to the oplog. |
例子
To append a non-operational entry to the oplog, use the
db.adminCommand()
method:
db.adminCommand( { appendOplogNote: 1, data: { msg: "Appending test message to oplog" } } )
例子 oplog
entry:
{ op: "n", ns: "", o: { msg: "Appending test message to oplog" }, ts: Timestamp({ t: 1689177321, i: 1 }), t: Long("1"), v: Long("2"), wall: ISODate("2023-07-12T15:55:21.180Z") }