Join us at MongoDB.local London on 7 May to unlock new possibilities for your data. Use WEB50 to save 50%.
Register now >
Docs Menu
Docs Home
/ /

appendOplogNote (database command)

appendOplogNote

Writes a non-operational entry to the oplog.

This command is available in deployments hosted in the following environments:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

Important

This command is not supported in M0 and Flex clusters. For more information, see Unsupported Commands.

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

The command has this syntax:

db.adminCommand(
{
appendOplogNote: 1,
data: <document>
}
)
Field
Type
Description

appendOplogNote

any

Set to any value.

data

document

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

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

Back

Replication

On this page