Skip to content

Commit f3945f4

Browse files
Merge pull request #58 from kanchana-mongodb/DOCSP-12636
DOCSP-12636 doc for Replica Set Status
2 parents 10bf94a + 49c7c83 commit f3945f4

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

source/reference/methods.txt

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,3 +876,99 @@ Role Management Methods
876876
* - :method:`db.updateRole()`
877877

878878
- Updates a user-defined role.
879+
880+
Replication Methods
881+
-------------------
882+
883+
.. list-table::
884+
:widths: 30 70
885+
:header-rows: 1
886+
887+
* - Method
888+
889+
- Description
890+
891+
* - ``rs.printSecondaryReplicationInfo``
892+
893+
- Returns the status of the secondary members of the replica set.
894+
895+
This is identical to the ``db.printSecondaryReplicationInfo()``
896+
method. This method returns the same output as the
897+
:method:`rs.printSlaveReplicationInfo()` method in the legacy
898+
:binary:`~mongo` shell. The :method:`rs.printSlaveReplicationInfo()` method is deprecated in ``mongosh``. Use
899+
``rs.printSecondaryReplicationInfo()`` instead.
900+
901+
The following is an example output from the
902+
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
903+
904+
.. code-block:: sh
905+
:copyable: false
906+
907+
source: rs2.example.net:27017
908+
{
909+
syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
910+
replLag: '0 secs (0 hrs) behind the primary '
911+
}
912+
---
913+
source: rs3.example.net:27017
914+
{
915+
syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
916+
replLag: '0 secs (0 hrs) behind the primary '
917+
}
918+
919+
* - ``db.printSecondaryReplicationInfo``
920+
921+
- Returns the status of the secondary members of the replica set.
922+
923+
This is identical to the ``rs.printSecondaryReplicationInfo()`` method.
924+
This method returns the same output as the
925+
:method:`db.printSlaveReplicationInfo()` method. The :method:`db.printSlaveReplicationInfo()` method is deprecated in ``mongosh``. Use
926+
``db.printSecondaryReplicationInfo()`` instead.
927+
928+
The following is an example output from the
929+
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
930+
931+
.. code-block:: sh
932+
:copyable: false
933+
934+
source: rs2.example.net:27017
935+
{
936+
syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
937+
replLag: '0 secs (0 hrs) behind the primary '
938+
}
939+
---
940+
source: rs3.example.net:27017
941+
{
942+
syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
943+
replLag: '0 secs (0 hrs) behind the primary '
944+
}
945+
946+
* - :method:`db.getReplicationInfo()`
947+
948+
- Returns the status of the replica set from the oplog data.
949+
950+
* - ``rs.isMaster``
951+
952+
- Returns the replica set configuration, role, and status for
953+
the ``mongod`` instance that ``mongosh`` is connected to.
954+
955+
The ``mongosh`` ``rs.isMaster()`` method wraps the server :dbcommand:`isMaster` command.
956+
957+
* - :method:`rs.printReplicationInfo()`
958+
959+
- Returns the oplog of the replica set member that ``mongosh`` is
960+
connected to.
961+
962+
This is identical to the :method:`db.printReplicationInfo()` method.
963+
964+
* - :method:`db.printReplicationInfo()`
965+
966+
- Returns the oplog of the replica set member that ``mongosh`` is
967+
connected to.
968+
969+
This is identical to the :method:`rs.printReplicationInfo()` method.
970+
971+
* - :method:`rs.status()`
972+
973+
- Returns the status of the replica set member that ``mongosh`` is
974+
connected to.

0 commit comments

Comments
 (0)