-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DOCS-1377 document missing isMaster fields #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
34621ca
DOCS-1377 document missing isMaster fields and related edits
8fc0e72
DOCS-1377 minor sphinx correction
86562b9
DOCS-1377 edits incorporating hannes' comments
1afeeae
DOCS-1377 incorporating comments
e156bd5
minor: add phrasing around hosts and arbiters arrays per hannes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,32 +6,86 @@ isMaster | |
|
||
.. dbcommand:: isMaster | ||
|
||
The :dbcommand:`isMaster` command provides a basic overview of the current | ||
replication configuration. MongoDB :term:`drivers <driver>` and | ||
The :dbcommand:`isMaster` command returns a document describing the | ||
role of the :program:`mongod` instance it is run against. If the | ||
instance is a member of a replica set, then :dbcommand:`isMaster` | ||
returns a subset of the replica set configuration and status including | ||
whether or not the instance is the :term:`primary` of the replica set. | ||
|
||
If sent to a :program:`mongod` instance which is not a member of a | ||
replica set, a subset of information is returned. | ||
|
||
MongoDB :term:`drivers <driver>` and | ||
:term:`clients <client>` use this command to determine what kind of | ||
member they're connected to and to discover additional members of a | ||
:term:`replica set`. The :method:`db.isMaster()` method provides a | ||
wrapper around this database command. | ||
:term:`replica set`. | ||
|
||
The :method:`db.isMaster()` method provides a wrapper around this | ||
database command. | ||
|
||
The :dbcommand:`isMaster` command returns a :term:`document` whose | ||
contents vary depending on the role of the :program:`mongod` instance. | ||
|
||
The command takes the following form: | ||
|
||
.. code-block:: javascript | ||
|
||
{ isMaster: 1 } | ||
|
||
This command returns a :term:`document` containing the | ||
following fields: | ||
|
||
.. data:: isMaster.setname | ||
**Common Fields** | ||
|
||
The name of the current replica set, if applicable. | ||
The following :dbcommand:`isMaster` fields are common across all roles: | ||
|
||
.. data:: isMaster.ismaster | ||
|
||
A boolean value that reports when this node is writable. If | ||
``true``, then the current node is either a :term:`primary` in a | ||
:term:`replica set`, a :term:`master` in a master-slave | ||
configuration, or a standalone :program:`mongod`. | ||
``true``, then this instance is a :term:`primary` in a | ||
:term:`replica set`, or a :term:`master` in a master-slave | ||
configuration, or a :program:`mongos` instance, or a standalone | ||
:program:`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:: isMaster.maxBsonObjectSize | ||
|
||
The maximum permitted size of a :term:`BSON` object in bytes for | ||
this :program:`mongod` process. If not provided, clients should | ||
assume a max size of "``4 * 1024 * 1024``". | ||
|
||
.. data:: isMaster.maxMessageSizeBytes | ||
|
||
.. versionadded:: 2.3.2 | ||
|
||
The maximum permitted size of a :term:`BSON` wire protocol message. | ||
The default value is ``48000000`` bytes. | ||
|
||
.. data:: isMaster.localTime | ||
|
||
.. versionadded:: 2.1.1 | ||
|
||
Returns the local server time in UTC. This value is an | ||
:term:`ISOdate`. | ||
|
||
**Shard Servers** | ||
|
||
:program:`mongos` instances add the following field to the | ||
:dbcommand:`isMaster` response document: | ||
|
||
.. data:: isMaster.msg | ||
|
||
Contains the value ``isdbgrid`` when :dbcommand:`isMaster` | ||
is sent to a :program:`mongos` instance. | ||
|
||
**Replica Sets** | ||
|
||
The following :dbcommand:`isMaster` fields are added to the common | ||
fields when the instance is a member of a replica set: | ||
|
||
.. data:: isMaster.setName | ||
|
||
The name of the current replica set. | ||
|
||
.. data:: isMaster.secondary | ||
|
||
|
@@ -41,52 +95,70 @@ isMaster | |
|
||
.. data:: isMaster.hosts | ||
|
||
An array of strings in the format of "``[hostname]:[port]``" | ||
listing all members of the :term:`replica set` that are not | ||
":term:`hidden <hidden member>`". | ||
An array of strings in the format of ``"[hostname]:[port]"`` | ||
listing all members of the :term:`replica set` that are neither | ||
:term:`hidden <hidden member>`, :term:`passive <passive member>`, | ||
nor :term:`arbiters <arbiter>`. | ||
|
||
.. data:: isMaster.arbiter | ||
Drivers use this array and the :data:`isMaster.passives` to determine | ||
which members to read from. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not list arbiters either |
||
An array of strings in the format of "``[hostname]:[port]``" | ||
listing all members of the :term:`replica set` that are | ||
:term:`arbiters <arbiter>` | ||
.. data:: isMaster.passives | ||
|
||
Only appears in the :dbcommand:`isMaster` response for replica | ||
sets that have arbiter members. | ||
An array of strings in the format of ``"[hostname]:[port]"`` | ||
listing all members of the :term:`replica set` which have a | ||
:ref:`priority <replica-set-node-priority>` of ``0``. | ||
|
||
.. data:: isMaster.arbiterOnly | ||
This field only appears if there is at least one member with a | ||
:ref:`priority <replica-set-node-priority>` of ``0``. | ||
|
||
Drivers use this array and the :data:`isMaster.hosts` to determine | ||
which members to read from. | ||
|
||
A boolean value that, when ``true`` indicates that the current | ||
instance is an :term:`arbiter`. | ||
.. data:: isMaster.arbiters | ||
|
||
:data:`~isMaster.arbiterOnly` only appears in the | ||
:dbcommand:`isMaster` response from arbiters. | ||
An array of strings in the format of ``"[hostname]:[port]"`` | ||
listing all members of the :term:`replica set` that are | ||
:term:`arbiters <arbiter>`. | ||
|
||
This field only appears if there is at least one arbiter in the | ||
replica set. | ||
|
||
.. data:: isMaster.primary | ||
|
||
The ``[hostname]:[port]`` for the current | ||
:term:`replica set` :term:`primary`, if applicable. | ||
A string in the format of ``"[hostname]:[port]"`` listing the | ||
current :term:`primary` member of the replica set. | ||
|
||
.. data:: isMaster.me | ||
.. data:: isMaster.arbiterOnly | ||
|
||
The ``[hostname]:[port]`` of the node responding to this | ||
command. | ||
A boolean value that indicates that the current instance is an | ||
:term:`arbiter`. | ||
The :data:`~isMaster.arbiterOnly` field will only be present, with | ||
a value of ``true``, if the instance is an arbiter. | ||
|
||
.. data:: isMaster.maxBsonObjectSize | ||
.. data:: isMaster.passive | ||
|
||
The maximum permitted size of a :term:`BSON` object in bytes for | ||
this :program:`mongod` process. If not provided, clients should | ||
assume a max size of "``4 * 1024 * 1024``". | ||
A boolean value that indicates that the current instance is | ||
:term:`hidden`. | ||
The :data:`~isMaster.passive` field will only be present, with | ||
a value of ``true``, if the instance is hidden. | ||
|
||
.. data:: isMaster.localTime | ||
.. data:: isMaster.hidden | ||
|
||
.. versionadded:: 2.1.1 | ||
A boolean value that indicates that the current instance is | ||
:term:`hidden`. | ||
The :data:`~isMaster.hidden` field will only be present, with | ||
a value of ``true``, if the instance is hidden. | ||
|
||
.. data:: isMaster.tags | ||
|
||
A document that lists any tags assigned to this member. | ||
This field is only present if there are tags assigned to the member. | ||
|
||
.. data:: isMaster.me | ||
|
||
Returns the local server time in UTC. This value is a | ||
:term:`ISOdate`. You can use the :js:func:`toString()` | ||
JavaScript method to convert this value to a local date string, | ||
as in the following example: | ||
The ``[hostname]:[port]`` of the member responding to this command. | ||
|
||
.. code-block:: javascript | ||
.. seealso:: | ||
|
||
db.isMaster().localTime.toString(); | ||
:method:`db.isMaster()` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this one was added in 2.4, and maxBsonObjectSize in 2.0
That should probably be included since the localTime field has a 'versionadded' statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I added a versionadded for maxMesageSizeBytes (2.3.2 is where I found it) but am not adding one for MaxBSONSize because it seems to predate 1.9.x