db.getReplicationInfo() returns a JSON document that summarizes MongoDB replica-set replication status from oplog data. Use it to inspect oplog capacity, usage, coverage window, and timestamps when diagnosing replication problems. The method works only on M10 clusters and larger. section 9.1.3
Read the returned fields as operational signals:
- Use timeDiff and timeDiffHours to determine the time span between the earliest and latest oplog entries. section 9.1.3
Inspect replication information
Run db.getReplicationInfo(). A sample response reports a 4096 MB configured and actual oplog, 4074.63 MB used, and a 176.43-hour time window. Because the output is JSON, it can support script-based automation. section 9.1.3
