Docs HomeMongoDB Manual

appendOplogNote

On this page

Definition

appendOplogNote

Writes a non-operational entry to the oplog.

Syntax

You can only issue the appendOplogNote command against the admin database.

db.adminCommand(
   {
      appendOplogNote: 1
      data: <document>
   }
)

Command Fields

FieldTypeDescription
appendOplogNoteanySet to any value.
datadocumentThe document to append to the oplog.

Example

To append a non-operational entry to the oplog, use the db.adminCommand() method:

db.adminCommand(
   {
      appendOplogNote: 1
      data: {
         msg: "Appending test msg to oplog"
      }
   }
)

Example oplog entry:

{
   op: "n",
   ns: "",
   o: {
      msg: "Appending test msg to oplog"
   },
   ts: Timestamp({ t: 1689177321, i: 1 }),
   t: Long("1"),
   v: Long("2"),
   wall: ISODate("2023-07-12T15:55:21.180Z")
}