diff --git a/source/core/replica-set-hidden-member.txt b/source/core/replica-set-hidden-member.txt index 2eb943ddcfc..d37d36e9ee7 100644 --- a/source/core/replica-set-hidden-member.txt +++ b/source/core/replica-set-hidden-member.txt @@ -19,7 +19,7 @@ data set but is **invisible** to client applications. Hidden members are good for workloads with different usage patterns from the other members in the :term:`replica set`. Hidden members must always be :ref:`priority 0 members ` and -so **cannot become primary**. The :method:`db.isMaster()` method does not +so **cannot become primary**. The :method:`db.hello()` method does not display hidden members. Hidden members, however, **may vote** in :ref:`elections `. diff --git a/source/core/sharded-cluster-query-router.txt b/source/core/sharded-cluster-query-router.txt index c1fd983a579..49dfabda4a9 100644 --- a/source/core/sharded-cluster-query-router.txt +++ b/source/core/sharded-cluster-query-router.txt @@ -205,15 +205,15 @@ Confirm Connection to ``mongos`` Instances ------------------------------------------ To detect if the MongoDB instance that your client is connected -to is :binary:`~bin.mongos`, use the :dbcommand:`isMaster` command. When a -client connects to a :binary:`~bin.mongos`, :dbcommand:`isMaster` returns +to is :binary:`~bin.mongos`, use the :dbcommand:`hello` command. When a +client connects to a :binary:`~bin.mongos`, :dbcommand:`hello` returns a document with a ``msg`` field that holds the string ``isdbgrid``. For example: .. code-block:: javascript { - "ismaster" : true, + "isWritablePrimary" : true, "msg" : "isdbgrid", "maxBsonObjectSize" : 16777216, "ok" : 1, diff --git a/source/includes/extracts-transactions.yaml b/source/includes/extracts-transactions.yaml index fd729ccf4d0..45441b727b5 100644 --- a/source/includes/extracts-transactions.yaml +++ b/source/includes/extracts-transactions.yaml @@ -116,7 +116,7 @@ content: | ref: transactions-operations-restrictions-info content: | - Informational commands, such as :dbcommand:`isMaster`, + Informational commands, such as :dbcommand:`hello`, :dbcommand:`buildInfo`, :dbcommand:`connectionStatus` (and their helper methods) are allowed in transactions; however, they cannot be the first operation in the transaction. diff --git a/source/includes/fact-bulkwrite-operation-batches.rst b/source/includes/fact-bulkwrite-operation-batches.rst index 1ac92e29f53..51ef94797f8 100644 --- a/source/includes/fact-bulkwrite-operation-batches.rst +++ b/source/includes/fact-bulkwrite-operation-batches.rst @@ -1,7 +1,7 @@ The number of operations in each group cannot exceed the value of the :limit:`maxWriteBatchSize ` of the database. As of MongoDB 3.6, this value is ``100,000``. -This value is shown in the :data:`isMaster.maxWriteBatchSize` field. +This value is shown in the :data:`hello.maxWriteBatchSize` field. This limit prevents issues with oversized error messages. If a group exceeds this :limit:`limit `, diff --git a/source/reference/command.txt b/source/reference/command.txt index a21732ac6f6..c18a0eb3238 100644 --- a/source/reference/command.txt +++ b/source/reference/command.txt @@ -335,9 +335,13 @@ Replication Commands - Internal command that applies :term:`oplog` entries to the current data set. + * - :dbcommand:`hello` + + - Displays information about this member's role in the replica set, including whether it is the primary. + * - :dbcommand:`isMaster` - - Displays information about this member's role in the replica set, including whether it is the master. + - *Deprecated*. Use :dbcommand:`hello` instead. * - :dbcommand:`replSetAbortPrimaryCatchUp` diff --git a/source/reference/command/hello.txt b/source/reference/command/hello.txt new file mode 100644 index 00000000000..f5e9a28d1e2 --- /dev/null +++ b/source/reference/command/hello.txt @@ -0,0 +1,348 @@ +===== +hello +===== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. dbcommand:: hello + + .. versionadded:: 4.4.2 (and 4.2.10, 4.0.21, and 3.6.21) + + :dbcommand:`hello` returns a document that describes the role of + the :binary:`~bin.mongod` instance. If the optional field + ``saslSupportedMechs`` is specified, the command also returns an + :data:`array of SASL mechanisms ` used + to create the specified user's credentials. + + If the instance is a member of a + replica set, then :dbcommand:`hello` returns a subset of the + replica set configuration and status including whether or not the + instance is the :term:`primary` of the replica set. + + When sent to a :binary:`~bin.mongod` instance that is not a member of a + replica set, :dbcommand:`hello` returns a subset of this + information. + + MongoDB :term:`drivers ` and :term:`clients ` use + :dbcommand:`hello` to determine the state of the replica set + members and to discover additional members of a :term:`replica + set`. + +Syntax +------ + +The command takes the following form: + +.. code-block:: javascript + + db.runCommand( { hello: 1 } ) + +The :dbcommand:`hello` command accepts optional fields +``saslSupportedMechs: `` to return an additional field +:data:`hello.saslSupportedMechs` in its result and ``comment `` to +add a log comment associated with the command. + +.. code-block:: javascript + + db.runCommand( { hello: 1, saslSupportedMechs: "", comment: } ) + +The :method:`db.hello()` method in the :binary:`~bin.mongo` shell +provides a wrapper around :dbcommand:`hello`. + +Behavior +-------- + +.. |operation| replace:: :dbcommand:`hello` + +Client Disconnection +~~~~~~~~~~~~~~~~~~~~~ + +.. include:: /includes/extracts/4.2-changes-disconnect.rst + +Output +------ + +All Instances +~~~~~~~~~~~~~ + +The following :dbcommand:`hello` fields are common across all +roles: + +.. data:: hello.isWritablePrimary + + A boolean value that reports when this node is writable. If + ``true``, then this instance is a :term:`primary` in a + :term:`replica set`, or a :binary:`~bin.mongos` instance, or a standalone + :binary:`~bin.mongod`. + + This field will be ``false`` if the instance is a + :term:`secondary` member of a replica set or if the member is an + :term:`arbiter` of a replica set. + +.. data:: hello.topologyVersion + + *For internal use by MongoDB.* + +.. data:: hello.maxBsonObjectSize + + The maximum permitted size of a :term:`BSON` object in bytes for + this :binary:`~bin.mongod` process. If not provided, clients should + assume a max size of "``16 * 1024 * 1024``". + +.. data:: hello.maxMessageSizeBytes + + The maximum permitted size of a :term:`BSON` wire protocol message. + The default value is ``48000000`` bytes. + +.. data:: hello.maxWriteBatchSize + + The maximum number of write operations permitted in a write batch. + If a batch exceeds this + :limit:`limit`, the client + driver divides the batch into smaller groups each with counts less + than or equal to the value of this field. + + The value of this limit is ``100,000`` writes. + + The limit raises from ``1,000`` to ``100,000`` writes. This limit + also applies to legacy ``OP_INSERT`` messages. + +.. data:: hello.localTime + + Returns the local server time in UTC. This value is an + :term:`ISO date `. + +.. data:: hello.logicalSessionTimeoutMinutes + + .. include:: /includes/fact-session-timeout.rst + + Only available when ``featureCompatibilityVersion`` is ``"3.6"`` or greater. + See :ref:`3.6-compatibility-enabled`. + +.. data:: hello.connectionId + + An identifier for the :binary:`~bin.mongod`/:binary:`~bin.mongos` + instance's outgoing connection to the client. + +.. data:: hello.minWireVersion + + The earliest version of the wire protocol that this + :binary:`~bin.mongod` or :binary:`~bin.mongos` instance is capable of using + to communicate with clients. + + Clients may use :data:`~hello.minWireVersion` to help negotiate + compatibility with MongoDB. + +.. data:: hello.maxWireVersion + + The latest version of the wire protocol that this :binary:`~bin.mongod` + or :binary:`~bin.mongos` instance is capable of using to communicate + with clients. + + Clients may use :data:`~hello.maxWireVersion` to help negotiate + compatibility with MongoDB. + +.. data:: hello.readOnly + + A boolean value that, when ``true``, indicates that the + :binary:`~bin.mongod` or :binary:`~bin.mongos` is running in read-only mode. + +.. data:: hello.compression + + An array listing the compression algorithms used or available for + use (i.e. common to both the client and the :binary:`~bin.mongod` or + :binary:`~bin.mongos` instance) to compress the communication + between the client and the :binary:`~bin.mongod` or + :binary:`~bin.mongos` instance. + + The field is only available if compression is used. For example: + + - If the :binary:`~bin.mongod` is enabled to use both the + ``snappy,zlib`` compressors and a client has specified ``zlib``, + the :data:`~hello.compression` field would contain: + + .. code-block:: javascript + + "compression": [ "zlib" ] + + - If the :binary:`~bin.mongod` is enabled to use both the + ``snappy,zlib`` compressors and a client has specified ``zlib,snappy``, + the :data:`~hello.compression` field would contain: + + .. code-block:: javascript + + "compression": [ "zlib", "snappy" ] + + - If the :binary:`~bin.mongod` is enabled to use the + ``snappy`` compressor and a client has specified ``zlib,snappy``, + the :data:`~hello.compression` field would contain : + + .. code-block:: javascript + + "compression": [ "snappy" ] + + - If the :binary:`~bin.mongod` is enabled to use the ``snappy`` + compressor and a client has specified ``zlib`` or the client has + specified no compressor, the field is omitted. + + That is, if the client does not specify compression or if the client + specifies a compressor not enabled for the connected + :binary:`~bin.mongod` or :binary:`~bin.mongos` instance, the field + does not return. + +.. data:: hello.saslSupportedMechs + + An array of SASL mechanisms used to create the user's credential or + credentials. Supported SASL mechanisms are: + + - ``GSSAPI`` + - ``SCRAM-SHA-256`` + - ``SCRAM-SHA-1`` + + The field is returned only when the command is run with the + ``saslSupportedMechs`` field: + + .. code-block:: javascript + + db.runCommand( { hello: 1, saslSupportedMechs: "" } ) + +Sharded Instances +~~~~~~~~~~~~~~~~~ + +:binary:`~bin.mongos` instances add the following field to the +:dbcommand:`hello` response document: + +.. data:: hello.msg + + Contains the value ``isdbgrid`` when :dbcommand:`hello` + returns from a :binary:`~bin.mongos` instance. + +Replica Sets +~~~~~~~~~~~~ + +:dbcommand:`hello` contains these fields when returned by a member +of a replica set: + +.. data:: hello.hosts + + An array of strings in the format of ``"[hostname]:[port]"`` that + lists all members of the :term:`replica set` that are neither + :term:`hidden `, :term:`passive `, + nor :term:`arbiters `. + + Drivers use this array and the :data:`hello.passives` to determine + which members to read from. + +.. data:: hello.setName + + The name of the current :replica set. + +.. data:: hello.setVersion + + The current replica set config version. + +.. data:: hello.secondary + + A boolean value that, when ``true``, indicates if the + :binary:`~bin.mongod` is a :term:`secondary` member of a :term:`replica + set`. + +.. data:: hello.passives + + An array of strings in the format of ``"[hostname]:[port]"`` + listing all members of the :term:`replica set` which have a + :rsconf:`members[n].priority` of ``0``. + + This field only appears if there is at least one member with a + :rsconf:`members[n].priority` of ``0``. + + Drivers use this array and the :data:`hello.hosts` to determine + which members to read from. + +.. data:: hello.arbiters + + An array of strings in the format of ``"[hostname]:[port]"`` + listing all members of the :term:`replica set` that are + :term:`arbiters `. + + This field only appears if there is at least one arbiter in the + replica set. + +.. data:: hello.primary + + A string in the format of ``"[hostname]:[port]"`` listing the + current :term:`primary` member of the replica set. + +.. data:: hello.arbiterOnly + + A boolean value that , when ``true``, indicates that the current + instance is an :term:`arbiter`. The :data:`~hello.arbiterOnly` + field is only present, if the instance is an arbiter. + +.. data:: hello.passive + + A boolean value that, when ``true``, indicates that the current + instance is :term:`passive `. The + :data:`~hello.passive` field is only present for members with a + :rsconf:`members[n].priority` of ``0``. + +.. data:: hello.hidden + + A boolean value that, when ``true``, indicates that the current + instance is :term:`hidden `. The + :data:`~hello.hidden` field is only present for hidden members. + +.. data:: hello.tags + + .. include:: /includes/fact-tags-field.rst + + .. seealso:: :rsconf:`members[n].tags` + +.. data:: hello.me + + The ``[hostname]:[port]`` of the member that returned + :dbcommand:`hello`. + +.. data:: hello.electionId + + A unique identifier for each election. Included only in the output + of :dbcommand:`hello` for the :term:`primary`. Used by clients + to determine when elections occur. + +.. data:: hello.lastWrite + + A document containing :term:`optime` and date information for the + database's most recent write operation. + + .. data:: hello.lastWrite.opTime + + An object giving the :term:`optime` of the last write operation. + + .. data:: hello.lastWrite.lastWriteDate + + A date object containing the + time of the last write operation. + + .. data:: hello.lastWrite.majorityOpTime + + An object giving the :term:`optime` of the last write operation + readable by :readconcern:`majority <"majority">` reads. + + .. data:: hello.lastWrite.majorityWriteDate + + A date object containing the + time of the last write operation readable by + :readconcern:`majority <"majority">` reads. + +For details on the ``ok`` status field, the ``operationTime`` field, +and the ``$clusterTime`` field, see +:ref:`Command Response `. diff --git a/source/reference/command/isMaster.txt b/source/reference/command/isMaster.txt index cec56f6fa2e..2d8652960dd 100644 --- a/source/reference/command/isMaster.txt +++ b/source/reference/command/isMaster.txt @@ -15,6 +15,8 @@ Definition .. dbcommand:: isMaster + .. deprecated:: 4.4.2 Use :dbcommand:`hello` instead. + :dbcommand:`isMaster` returns a document that describes the role of the :binary:`~bin.mongod` instance. If the optional field ``saslSupportedMechs`` is specified, the command also returns an diff --git a/source/reference/command/isdbgrid.txt b/source/reference/command/isdbgrid.txt index 24f018b4340..2179b70480c 100644 --- a/source/reference/command/isdbgrid.txt +++ b/source/reference/command/isdbgrid.txt @@ -40,7 +40,7 @@ isdbgrid "ok" : 0 } - You can instead use the :dbcommand:`isMaster` command to determine + You can instead use the :dbcommand:`hello` command to determine connection to a :binary:`~bin.mongos`. When connected to a - :binary:`~bin.mongos`, the :dbcommand:`isMaster` command returns a document that + :binary:`~bin.mongos`, the :dbcommand:`hello` command returns a document that contains the string ``isdbgrid`` in the ``msg`` field. diff --git a/source/reference/command/nav-replication.txt b/source/reference/command/nav-replication.txt index 9a182001a59..cb460ba6db5 100644 --- a/source/reference/command/nav-replication.txt +++ b/source/reference/command/nav-replication.txt @@ -24,9 +24,13 @@ Replication Commands - Internal command that applies :term:`oplog` entries to the current data set. + * - :dbcommand:`hello` + + - Displays information about this member's role in the replica set, including whether it is the primary. + * - :dbcommand:`isMaster` - - Displays information about this member's role in the replica set, including whether it is the master. + - *Deprecated*. Use :dbcommand:`hello` instead. * - :dbcommand:`replSetAbortPrimaryCatchUp` @@ -70,10 +74,11 @@ Replication Commands .. toctree:: - :titlesonly: - :hidden: + :titlesonly: + :hidden: /reference/command/applyOps + /reference/command/hello /reference/command/isMaster /reference/command/replSetAbortPrimaryCatchUp /reference/command/replSetFreeze diff --git a/source/reference/command/serverStatus.txt b/source/reference/command/serverStatus.txt index a9f3926e42c..eacc51e6600 100644 --- a/source/reference/command/serverStatus.txt +++ b/source/reference/command/serverStatus.txt @@ -272,6 +272,7 @@ connections "totalCreated" : , "active" : , "exhaustIsMaster" : , + "exhaustHello" : , "awaitingTopologyChanges" : }, @@ -321,10 +322,17 @@ connections .. versionadded:: 4.4 +.. serverstatus:: connections.exhaustHello + + The number of connections whose last request was a :dbcommand:`hello` + request with :ref:`exhaustAllowed `. + + .. versionadded:: 4.4.2 + .. serverstatus:: connections.awaitingTopologyChanges - The number of clients currently waiting in an :dbcommand:`isMaster` - request for a topology change. + The number of clients currently waiting in a :dbcommand:`hello` or + an :dbcommand:`isMaster` request for a topology change. .. versionadded:: 4.4 diff --git a/source/reference/method.txt b/source/reference/method.txt index 9881315e0e3..b56122d504c 100644 --- a/source/reference/method.txt +++ b/source/reference/method.txt @@ -490,6 +490,10 @@ Database - Provides access to the specified database. + * - :method:`db.hello()` + + - Returns a document that reports the state of the replica set. + * - :method:`db.help()` - Displays descriptions of common ``db`` object methods. @@ -500,7 +504,7 @@ Database * - :method:`db.isMaster()` - - Returns a document that reports the state of the replica set. + - *Deprecated*. Use :method:`db.hello()` instead. * - :method:`db.killOp()` diff --git a/source/reference/method/db.auth.txt b/source/reference/method/db.auth.txt index abb05102142..a13ccf78637 100644 --- a/source/reference/method/db.auth.txt +++ b/source/reference/method/db.auth.txt @@ -147,16 +147,16 @@ The :method:`db.auth()` has the following syntax forms: - string - Optional. The :ref:`authentication mechanism - ` to use. - + ` to use. + For available mechanisms, see :ref:`authentication mechanisms - `. - - If unspecified, uses the :dbcommand:`isMaster` to determine the SASL - mechanism or mechanisms for the specified user. See - :data:`~isMaster.saslSupportedMechs`. - - + `. + + If unspecified, uses the :dbcommand:`hello` command to determine + the SASL mechanism or mechanisms for the specified user. See + :data:`~hello.saslSupportedMechs`. + + * - ``digestPassword`` diff --git a/source/reference/method/db.hello.txt b/source/reference/method/db.hello.txt new file mode 100644 index 00000000000..14ed48f2b99 --- /dev/null +++ b/source/reference/method/db.hello.txt @@ -0,0 +1,26 @@ +========== +db.hello() +========== + +.. default-domain:: mongodb + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +.. method:: db.hello() + + .. versionadded:: 4.4.2 (and 4.2.10, 4.0.21, and 3.6.21) + + Returns a document that describes the role of the :binary:`~bin.mongod` + instance. + + If the :binary:`~bin.mongod` is a member of a :term:`replica set`, then + the :data:`~hello.isWritablePrimary` and :data:`~hello.secondary` + fields report if the instance is the :term:`primary` or if it is a + :term:`secondary` member of the replica set. + + .. see:: :dbcommand:`hello` for the complete documentation of + the output of :method:`db.hello()`. diff --git a/source/reference/method/db.isMaster.txt b/source/reference/method/db.isMaster.txt index e1ce9178135..e39e3c08cee 100644 --- a/source/reference/method/db.isMaster.txt +++ b/source/reference/method/db.isMaster.txt @@ -12,6 +12,8 @@ db.isMaster() .. method:: db.isMaster() + .. deprecated:: 4.4.2 Use :method:`db.hello()` instead. + Returns a document that describes the role of the :binary:`~bin.mongod` instance. diff --git a/source/reference/method/js-database.txt b/source/reference/method/js-database.txt index 6daa670317a..5f4197f730e 100644 --- a/source/reference/method/js-database.txt +++ b/source/reference/method/js-database.txt @@ -116,6 +116,10 @@ Database Methods - Provides access to the specified database. + * - :method:`db.hello()` + + - Returns a document that reports the state of the replica set. + * - :method:`db.help()` - Displays descriptions of common ``db`` object methods. @@ -126,7 +130,7 @@ Database Methods * - :method:`db.isMaster()` - - Returns a document that reports the state of the replica set. + - *Deprecated*. Use :method:`db.hello()` instead. * - :method:`db.killOp()` @@ -238,6 +242,7 @@ Database Methods /reference/method/db.getProfilingStatus /reference/method/db.getReplicationInfo /reference/method/db.getSiblingDB + /reference/method/db.hello /reference/method/db.help /reference/method/db.hostInfo /reference/method/db.isMaster diff --git a/source/reference/mongodb-wire-protocol.txt b/source/reference/mongodb-wire-protocol.txt index 6738cd8e70b..a3cff069fc8 100644 --- a/source/reference/mongodb-wire-protocol.txt +++ b/source/reference/mongodb-wire-protocol.txt @@ -121,7 +121,8 @@ Request Opcodes ~~~~~~~~~~~~~~~ .. note:: - Starting with MongoDB 2.6 and :data:`~isMaster.maxWireVersion` ``3``, + + Starting with MongoDB 2.6 and :data:`~hello.maxWireVersion` ``3``, MongoDB drivers use the :ref:`database commands` :dbcommand:`insert`, :dbcommand:`update`, and :dbcommand:`delete` instead of ``OP_INSERT``, ``OP_UPDATE``, and ``OP_DELETE`` for diff --git a/source/reference/replica-configuration.txt b/source/reference/replica-configuration.txt index 07d7db872fa..2fc80f8fe63 100644 --- a/source/reference/replica-configuration.txt +++ b/source/reference/replica-configuration.txt @@ -311,7 +311,7 @@ Replica Set Configuration Fields When this value is ``true``, the replica set hides this instance and does not include the member in the output of - :method:`db.isMaster()` or :dbcommand:`isMaster`. This prevents + :method:`db.hello()` or :dbcommand:`hello`. This prevents read operations (i.e. queries) from ever reaching this host by way of secondary :term:`read preference`. diff --git a/source/reference/replication.txt b/source/reference/replication.txt index c2c4f1d685e..15a31ba7156 100644 --- a/source/reference/replication.txt +++ b/source/reference/replication.txt @@ -99,9 +99,14 @@ Replication Database Commands - Internal command that applies :term:`oplog` entries to the current data set. + * - :dbcommand:`hello` + + - Displays information about this member's role in the replica set, + including whether it is the primary. + * - :dbcommand:`isMaster` - - Displays information about this member's role in the replica set, including whether it is the master. + - *Deprecated*. Use :method:`db.hello()` instead. * - :dbcommand:`replSetAbortPrimaryCatchUp` diff --git a/source/reference/security-client-side-query-aggregation-support.txt b/source/reference/security-client-side-query-aggregation-support.txt index fb8f5485c30..4eacfb6d5d9 100644 --- a/source/reference/security-client-side-query-aggregation-support.txt +++ b/source/reference/security-client-side-query-aggregation-support.txt @@ -71,8 +71,9 @@ field level encryption pass these commands directly to the - :dbcommand:`getMore` [#]_ - :dbcommand:`authenticate` - :dbcommand:`getnonce` +- :dbcommand:`hello` - :dbcommand:`logout` -- :dbcommand:`isMaster` +- :dbcommand:`isMaster` (deprecated) - :dbcommand:`abortTransaction` - :dbcommand:`commitTransaction` - :dbcommand:`endSessions` diff --git a/source/tutorial/configure-a-hidden-replica-set-member.txt b/source/tutorial/configure-a-hidden-replica-set-member.txt index 7a8e941ca63..04d26864c8a 100644 --- a/source/tutorial/configure-a-hidden-replica-set-member.txt +++ b/source/tutorial/configure-a-hidden-replica-set-member.txt @@ -68,7 +68,7 @@ to configure by its array index in the After re-configuring the set, this secondary member has a priority of ``0`` so that it cannot become primary and is hidden. The other members in the set will not advertise the hidden member in the -:dbcommand:`isMaster` or :method:`db.isMaster()` output. +:dbcommand:`hello` command or :method:`db.hello()` method output. .. include:: /includes/fact-rs-conf-array-index.rst diff --git a/source/tutorial/expand-replica-set.txt b/source/tutorial/expand-replica-set.txt index f4252ea9ea7..2aba17dd2c7 100644 --- a/source/tutorial/expand-replica-set.txt +++ b/source/tutorial/expand-replica-set.txt @@ -151,7 +151,7 @@ Add a Member to an Existing Replica Set You can only add members while connected to the primary. If you do not know which member is the primary, log into any member of the - replica set and issue the :method:`db.isMaster()` command. + replica set and issue the :method:`db.hello()` command. #. Use :method:`rs.add()` to add the new member to the replica set. Pass the :rsconf:`member configuration document ` to the diff --git a/source/tutorial/remove-replica-set-member.txt b/source/tutorial/remove-replica-set-member.txt index 689c5cd0495..b4b5d8484ee 100644 --- a/source/tutorial/remove-replica-set-member.txt +++ b/source/tutorial/remove-replica-set-member.txt @@ -22,7 +22,7 @@ Remove a Member Using ``rs.remove()`` method. #. Connect to the replica set's current :term:`primary`. To determine - the current primary, use :method:`db.isMaster()` while connected to + the current primary, use :method:`db.hello()` while connected to any member of the replica set. #. Use :method:`rs.remove()` in either of the following forms to @@ -64,7 +64,7 @@ Procedure method. #. Connect to the replica set's current :term:`primary`. To determine - the current primary, use :method:`db.isMaster()` while connected to + the current primary, use :method:`db.hello()` while connected to any member of the replica set. #. Issue the :method:`rs.conf()` method to view the current diff --git a/source/tutorial/restore-sharded-cluster.txt b/source/tutorial/restore-sharded-cluster.txt index 01bfa86dcb0..c1ab4d8e564 100644 --- a/source/tutorial/restore-sharded-cluster.txt +++ b/source/tutorial/restore-sharded-cluster.txt @@ -89,26 +89,26 @@ Shut Down Running MongoDB Processes use admin db.shutdownServer() - For hosts running a :binary:`mongod `, connect a + For hosts running a :binary:`mongod `, connect a :binary:`mongo ` shell to the ``mongod`` and - run :method:`db.isMaster()`: + run :method:`db.hello()`: - * If :data:`~isMaster.ismaster` is false, the ``mongod`` is a - :term:`secondary` member of a replica set. You + * If :data:`~hello.isWritablePrimary` is false, the ``mongod`` is a + :term:`secondary` member of a replica set. You can shut it down by running :method:`db.shutdownServer()` from the ``admin`` database. - * If :data:`~isMaster.ismaster` is true, the ``mongod`` is the + * If :data:`~hello.isWritablePrimary` is true, the ``mongod`` is the :term:`primary` member of a replica set. Shut down the secondary members of the replica set *first*. Use :method:`rs.status()` to identify the other members of the replica set. - The primary automatically steps down after it detects a + The primary automatically steps down after it detects a majority of members are offline. After it steps down - (:method:`db.isMaster` returns - :data:`ismaster: false `), you can safely - shut down the ``mongod`` + (:method:`db.hello` returns + :data:`isWritablePrimary: false `), you can + safely shut down the ``mongod``. Prepare Data Directory Create a directory on the target host for the restored database diff --git a/source/tutorial/use-database-commands.txt b/source/tutorial/use-database-commands.txt index 04d63a9526c..d263e4b8749 100644 --- a/source/tutorial/use-database-commands.txt +++ b/source/tutorial/use-database-commands.txt @@ -25,12 +25,12 @@ Database Command Form You specify a command first by constructing a standard :term:`BSON` document whose first key is the name of the command. For example, -specify the :dbcommand:`isMaster` command using the following +specify the :dbcommand:`hello` command using the following :term:`BSON` document: .. code-block:: javascript - { isMaster: 1 } + { hello: 1 } .. _issue-commands: @@ -43,7 +43,7 @@ commands called :method:`db.runCommand()`. The following operation in .. code-block:: javascript - db.runCommand( { isMaster: 1 } ) + db.runCommand( { hello: 1 } ) Many :driver:`Drivers ` provide an equivalent for the :method:`db.runCommand()` method. Internally, running commands @@ -52,7 +52,7 @@ against the :term:`$cmd` collection. Many common commands have their own shell helpers or wrappers in the :binary:`~bin.mongo` shell and drivers, such as the -:method:`db.isMaster()` method in the :binary:`~bin.mongo` JavaScript +:method:`db.hello()` method in the :binary:`~bin.mongo` JavaScript shell. You can use the ``maxTimeMS`` option to specify a time limit for the