@@ -887,16 +887,54 @@ Replication Methods
887
887
* - Method
888
888
889
889
- Description
890
-
891
- * - ``rs.printSecondaryReplicationInfo``
890
+
891
+ * - :method:`rs.add()`
892
+
893
+ - Adds a member to the replica set. You must connect to the
894
+ primary of the replica set to run this method.
895
+
896
+ * - :method:`rs.addArb()`
897
+
898
+ - Adds an arbiter to an existing replica set.
899
+
900
+ * - :method:`rs.freeze()`
901
+
902
+ - Makes the replica set member that ``mongosh`` is connected to
903
+ ineligible to become primary for the specified duration.
904
+
905
+ * - :method:`db.getReplicationInfo()`
906
+
907
+ - Returns the status of the replica set from the oplog data.
908
+
909
+ * - ``rs.isMaster``
910
+
911
+ - Returns the replica set configuration, role, and status for
912
+ the ``mongod`` instance that ``mongosh`` is connected to.
913
+
914
+ The ``mongosh`` ``rs.isMaster()`` method wraps the server :dbcommand:`isMaster` command.
915
+
916
+ * - :method:`db.printReplicationInfo()`
917
+
918
+ - Returns the oplog of the replica set member that ``mongosh`` is
919
+ connected to.
920
+
921
+ This is identical to the :method:`rs.printReplicationInfo()` method.
922
+
923
+ * - :method:`rs.printReplicationInfo()`
924
+
925
+ - Returns the oplog of the replica set member that ``mongosh`` is
926
+ connected to.
927
+
928
+ This is identical to the :method:`db.printReplicationInfo()` method.
929
+
930
+ * - ``db.printSecondaryReplicationInfo``
892
931
893
932
- Returns the status of the secondary members of the replica set.
894
933
895
- This is identical to the ``db.printSecondaryReplicationInfo()``
896
- method. This method's output is similar to 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.
934
+ This is identical to the ``rs.printSecondaryReplicationInfo()`` method.
935
+ This method's output is similar to the
936
+ :method:`db.printSlaveReplicationInfo()` method. The :method:`db.printSlaveReplicationInfo()` method is deprecated in ``mongosh``. Use
937
+ ``db.printSecondaryReplicationInfo()`` instead.
900
938
901
939
The following is an example output from the
902
940
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
@@ -906,24 +944,25 @@ Replication Methods
906
944
907
945
source: rs2.example.net:27017
908
946
{
909
- syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
947
+ syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
910
948
replLag: '0 secs (0 hrs) behind the primary '
911
949
}
912
950
---
913
951
source: rs3.example.net:27017
914
952
{
915
- syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
953
+ syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
916
954
replLag: '0 secs (0 hrs) behind the primary '
917
955
}
918
956
919
- * - ``db .printSecondaryReplicationInfo``
957
+ * - ``rs .printSecondaryReplicationInfo``
920
958
921
959
- Returns the status of the secondary members of the replica set.
922
960
923
- This is identical to the ``rs.printSecondaryReplicationInfo()`` method.
924
- This method's output is similar to the
925
- :method:`db.printSlaveReplicationInfo()` method. The :method:`db.printSlaveReplicationInfo()` method is deprecated in ``mongosh``. Use
926
- ``db.printSecondaryReplicationInfo()`` instead.
961
+ This is identical to the ``db.printSecondaryReplicationInfo()``
962
+ method. This method's output is similar to the
963
+ :method:`rs.printSlaveReplicationInfo()` method in the legacy
964
+ :binary:`~mongo` shell. The :method:`rs.printSlaveReplicationInfo()` method is deprecated in ``mongosh``. Use
965
+ ``rs.printSecondaryReplicationInfo()`` instead.
927
966
928
967
The following is an example output from the
929
968
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
@@ -933,54 +972,33 @@ Replication Methods
933
972
934
973
source: rs2.example.net:27017
935
974
{
936
- syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
975
+ syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
937
976
replLag: '0 secs (0 hrs) behind the primary '
938
977
}
939
978
---
940
979
source: rs3.example.net:27017
941
980
{
942
- syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
981
+ syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
943
982
replLag: '0 secs (0 hrs) behind the primary '
944
983
}
945
984
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()`
985
+ * - :method:`rs.remove()`
965
986
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.
987
+ - Removes the member specified by hostname from the replica set.
970
988
971
989
* - :method:`rs.status()`
972
990
973
991
- Returns the status of the replica set member that ``mongosh`` is
974
992
connected to.
975
- * - :method:`rs.add()`
976
993
977
- - Adds a member to the replica set. You must connect to the
978
- primary of the replica set to run this method.
994
+ * - :method:`rs.stepDown()`
979
995
980
- * - :method:`rs.addArb()`
996
+ - Makes the primary of the replica set a secondary. You must be
997
+ connected to the primary to run this method.
981
998
982
- - Adds an arbiter to an existing replica set.
999
+ * - :method:`rs.syncFrom()`
983
1000
984
- * - :method:`rs.remove()`
1001
+ - Resets the sync target to the replica set member specified
1002
+ by hostname for the replica set member that ``mongosh`` is
1003
+ connected to.
985
1004
986
- - Removes the member specified by hostname from the replica set.
0 commit comments