Docs Home → Develop Applications → MongoDB Manual
db.printReplicationInfo()![](/docs/v5.3/assets/link.svg)
On this page
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoDB server.
Definition![](/docs/v5.3/assets/link.svg)
db.printReplicationInfo()
Prints a formatted report of the replica set member's oplog. The displayed report formats the data returned by
db.getReplicationInfo()
.The output of
db.printReplicationInfo()
is identical to that ofrs.printReplicationInfo()
.Note
The
db.printReplicationInfo()
method run inmongosh
does not return JSON. Usedb.printReplicationInfo()
for manual inspection, anddb.getReplicationInfo()
in scripts.
Output Example![](/docs/v5.3/assets/link.svg)
The following example is a sample output from the
db.printReplicationInfo()
method run on the primary:
configured oplog size: 192MB log length start to end: 65422secs (18.17hrs) oplog first event time: Mon Jun 23 2014 17:47:18 GMT-0400 (EDT) oplog last event time: Tue Jun 24 2014 11:57:40 GMT-0400 (EDT) now: Thu Jun 26 2014 14:24:39 GMT-0400 (EDT)
Output Fields![](/docs/v5.3/assets/link.svg)
db.printReplicationInfo()
formats and prints the data returned by
db.getReplicationInfo()
:
- configured oplog size
- Displays the
db.getReplicationInfo.logSizeMB
value. - log length start to end
- Displays the
db.getReplicationInfo.timeDiff
anddb.getReplicationInfo.timeDiffHours
values. - oplog first event time
- Displays the
db.getReplicationInfo.tFirst
. - oplog last event time
- Displays the
db.getReplicationInfo.tLast
. - now
- Displays the
db.getReplicationInfo.now
.
See db.getReplicationInfo()
for description of the data.