Skip to content

Commit 3440aeb

Browse files
author
Kay Kim
committed
DOCS-12251: isMaster - fix compression field description
1 parent e0f46cb commit 3440aeb

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

source/reference/command/isMaster.txt

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,23 +150,47 @@ roles:
150150
.. data:: isMaster.compression
151151

152152
.. versionadded:: 3.4
153+
154+
An array listing the compression algorithms used or available for
155+
use (i.e. common to both the client and the :binary:`~bin.mongod` or
156+
:binary:`~bin.mongos` instance) to compress the communication
157+
between the client and the :binary:`~bin.mongod` or
158+
:binary:`~bin.mongos` instance.
159+
160+
The field is only available if compression is used. For example:
161+
162+
- If the :binary:`~bin.mongod` is enabled to use both the
163+
``snappy,zlib`` compressors and a client has specified ``zlib``,
164+
the :data:`~isMaster.compression` field would contain:
165+
166+
.. code-block:: javascript
153167

154-
.. versionchanged:: 3.6 In MongoDB 3.6, :data:`~isMaster.compression`
155-
appears by default. Previously, :data:`~isMaster.compression` only
156-
appeared if the network connection was compressed.
168+
"compression": [ "zlib" ]
169+
170+
- If the :binary:`~bin.mongod` is enabled to use both the
171+
``snappy,zlib`` compressors and a client has specified ``zlib,snappy``,
172+
the :data:`~isMaster.compression` field would contain:
173+
174+
.. code-block:: javascript
157175

158-
An array listing the compression algorithms used to compress the
159-
current connection's network communication between the
160-
:binary:`~bin.mongod` or :binary:`~bin.mongos` and other members of the
161-
deployment or the :binary:`~bin.mongo` shell.
176+
"compression": [ "zlib", "snappy" ]
162177

163-
For a :binary:`~bin.mongod` or :binary:`~bin.mongos` using the ``snappy``
164-
compressor , the :data:`~isMaster.compression` field would resemble
165-
the following:
178+
- If the :binary:`~bin.mongod` is enabled to use the
179+
``snappy`` compressor and a client has specified ``zlib,snappy``,
180+
the :data:`~isMaster.compression` field would contain :
166181

167-
.. code-block:: sh
182+
.. code-block:: javascript
168183

169-
"compression": [ "snappy" ]
184+
"compression": [ "snappy" ]
185+
186+
- If the :binary:`~bin.mongod` is enabled to use the ``snappy``
187+
compressor and a client has specified ``zlib`` or the client has
188+
specified no compressor, the field is omitted.
189+
190+
That is, if the client does not specify compression or if the client
191+
specifies a compressor not enabled for the connected
192+
:binary:`~bin.mongod` or :binary:`~bin.mongos` instance, the field
193+
does not return.
170194

171195
.. data:: isMaster.saslSupportedMechs
172196

0 commit comments

Comments
 (0)