The oplog window is the time span between the oldest and newest retained entries in a replica set's oplog. It indicates how long a secondary can remain behind before older replication operations disappear. section 9.1.3
Check and interpret the window with these mongosh commands:
- Run db.getReplicationInfo() for script-friendly JSON containing timeDiff, timeDiffHours, tFirst, tLast, and now. section 9.1.3
- Use rs.printReplicationInfo() for a manual mongosh check when JSON parsing is unnecessary. section 9.1.3
- Compare the window with secondary lag: a secondary must copy entries before they fall outside the retained time span. section 9.1.3
Reading a seven-day window
The sample output reports timeDiffHours: 176.43, with the first entry on March 20 and the last on March 27. The oplog is using 4074.63 MB of its configured 4096 MB, so the displayed window describes the current retained history rather than a fixed guarantee.
