Docs 菜单

appendOplogNote

appendOplogNote

oplog 写入一个非操作条目。

此命令可用于以下环境中托管的部署:

重要

M0 、M2 、M5 和 Flex 集群不支持此命令。有关更多信息,请参阅不支持的命令。

You can only run the appendOplogNote command on the admin database.

The command has this syntax:

db.adminCommand(
{
appendOplogNote: 1,
data: <document>
}
)
字段
类型
说明

appendOplogNote

any

Set to any value.

data

文档

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")
}