On this page本页内容
rs.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 rs.printReplicationInfo() is identical to that of db.printReplicationInfo().
Note
The rs.printReplicationInfo() in the mongo shell does not return JSON. Use rs.printReplicationInfo() for manual inspection, and db.getReplicationInfo() in scripts.
The following example is a sample output from the rs.printReplicationInfo() method run on the primary:
rs.printReplicationInfo() formats and prints the data returned by db.getReplicationInfo():
db.getReplicationInfo.logSizeMB value.db.getReplicationInfo.timeDiff and db.getReplicationInfo.timeDiffHours values.db.getReplicationInfo.tFirst.db.getReplicationInfo.tLast.db.getReplicationInfo.now.See db.getReplicationInfo() for description of the data.