db.printReplicationInfo() in mongoDB

printReplicationInfo()

This method prints a formatted report of the replica set member’s oplog.

Syntax:

db.printReplicationInfo() 


Example 1: When replica information not detected

MongoDB

db.printReplicationInfo()

Output

{ "errmsg" : "replication not detected" }


Example 2: When replica information is detected

MongoDB

db.printReplicationInfo()

Output:

configured oplog size:   192MB
log length start to end: 65422secs (12.05hrs)
oplog first event time:  Wed July 06 2022 17:47:18 GMT-0400 (EDT)
oplog last event time:   Wed July 06 2022 11:57:40 GMT-0400 (EDT)
now:                     Thu July 07 2022 14:24:39 GMT-0400 (EDT)


No comments:

Post a Comment