MongoDB : Check Replication Status

To check replication status, mongodb has rs.status() inbuilt function. abc:PRIMARY> rs.status function () { return db._adminCommand(“replSetGetStatus”); } rs.status ouput If secondary is synced and wasn’t created with slaveDelayoption then optime and optimeDate of secondary should be equal or close (if there are current operations) to those of primary. In that case stateStr should be equal […]