@@ -7,7 +7,7 @@ setFeatureCompatibilityVersion
7
7
.. contents:: On this page
8
8
:local:
9
9
:backlinks: none
10
- :depth: 1
10
+ :depth: 2
11
11
:class: singlecol
12
12
13
13
Definition
@@ -156,58 +156,47 @@ Examples
156
156
--------
157
157
158
158
.. _view-fcv:
159
+ .. _get-feature-compat-version:
159
160
160
- View FeatureCompatibilityVersion
161
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161
+ Get FeatureCompatibilityVersion
162
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162
163
163
164
To view the ``featureCompatibilityVersion`` for a :binary:`~bin.mongod`
164
- instance, run the following command on a :binary:`~bin.mongod` instance:
165
-
166
- .. note::
167
-
168
- The operation is undefined on the :binary:`~bin.mongos` instances. For a
169
- sharded cluster that has access control enabled, to run the command
170
- against a member of the shard replica set, you must connect to the
171
- member as a :ref:`shard local user <shard-local-users>`.
165
+ instance, run the :dbcommand:`getParameter` command on a
166
+ :binary:`~bin.mongod` instance:
172
167
173
168
.. code-block:: javascript
174
169
175
- db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
176
-
177
- The output from this command will resemble one of the following,
178
- depending on the current state of the :binary:`~bin.mongod`:
179
-
180
- - If the deployment has the default ``featureCompatibilityVersion``, or
181
- if the :dbcommand:`setFeatureCompatibilityVersion` command has run
182
- successfully against the deployment, the
183
- ``featureCompatibilityVersion`` has the form:
184
-
185
- .. code-block:: javascript
186
-
187
- "featureCompatibilityVersion" : {
188
- "version" : <version>
189
- }
170
+ db.adminCommand( {
171
+ getParameter: 1,
172
+ featureCompatibilityVersion: 1
173
+ }
174
+ )
190
175
191
- - If the :binary:`~bin.mongod` is in a partially upgraded or downgraded
192
- state, the ``featureCompatibilityVersion`` has the following form:
176
+ The output resembles:
193
177
194
- .. code-block:: javascript
178
+ .. code-block:: javascript
195
179
196
- "featureCompatibilityVersion" : {
197
- "version" : <version> ,
198
- "targetVersion" : <target version>
199
- }
180
+ {
181
+ featureCompatibilityVersion: { version: '5.0' },
182
+ ok: 1,
183
+ '$clusterTime': {
184
+ clusterTime: Timestamp({ t: 1660318752, i: 5 }),
185
+ signature: {
186
+ hash: Binary(Buffer.from("ce0cff3621e9b089fa6d8e9a1e1efc1a1ff15dab", "hex"), 0),
187
+ keyId: Long("7129893797260951557")
188
+ }
189
+ },
190
+ operationTime: Timestamp({ t: 1660318752, i: 5 })
191
+ }
200
192
201
- For instance, if a sharded cluster has a shard replica set that is
202
- read only when you run :dbcommand:`setFeatureCompatibilityVersion`
203
- command against the :binary:`~bin.mongos`, the command will fail, and the
204
- ``featureCompatibilityVersion`` of the config servers will include
205
- the ``targetVersion`` field.
193
+ .. note::
206
194
207
- Or if a replica set becomes read only while
208
- :dbcommand:`setFeatureCompatibilityVersion` is running, the command
209
- will fail, and the ``featureCompatibilityVersion`` of the replica set
210
- will include the ``targetVersion`` field as well.
195
+ The operation is undefined on the :binary:`~bin.mongos` instances.
196
+
197
+ On a sharded cluster that has access control enabled, you must
198
+ connect to the shard as a :ref:`shard local user <shard-local-users>`
199
+ to run the command.
211
200
212
201
.. _set-fcv:
213
202
0 commit comments