@@ -150,23 +150,47 @@ roles:
150
150
.. data:: isMaster.compression
151
151
152
152
.. 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
153
167
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
157
175
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" ]
162
177
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 :
166
181
167
- .. code-block:: sh
182
+ .. code-block:: javascript
168
183
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.
170
194
171
195
.. data:: isMaster.saslSupportedMechs
172
196
0 commit comments