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