On this page
rs.status()
rs.
status
( )-
Returns: A document with status information. This output reflects the current status of the replica set, using data derived from the heartbeat packets sent by the other members of the replica set.
This method provides a wrapper around the
replSetGetStatus
command.Starting in MongoDB 3.4, the
replSetGetStatus
command can accept the optionalinitialSync: 1
to report on initial sync status and progress if the command is run on the secondary. To report on initial sync for the secondary, you must run the command instead of the helper.See the documentation of the
replSetGetStatus
command for a complete description of the output.