Skip to content

Commit 2353b5d

Browse files
author
Dave Cuthbert
authored
DOCSP-24504 get featureCompatibilityVersion (#1637)
* DOCSP-24504 get featureCompatibilityVersion * Remove space
1 parent c8a02f2 commit 2353b5d

File tree

1 file changed

+31
-42
lines changed

1 file changed

+31
-42
lines changed

source/reference/command/setFeatureCompatibilityVersion.txt

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ setFeatureCompatibilityVersion
77
.. contents:: On this page
88
:local:
99
:backlinks: none
10-
:depth: 1
10+
:depth: 2
1111
:class: singlecol
1212

1313
Definition
@@ -156,58 +156,47 @@ Examples
156156
--------
157157

158158
.. _view-fcv:
159+
.. _get-feature-compat-version:
159160

160-
View FeatureCompatibilityVersion
161-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161+
Get FeatureCompatibilityVersion
162+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162163

163164
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:
172167

173168
.. code-block:: javascript
174169

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+
)
190175

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:
193177

194-
.. code-block:: javascript
178+
.. code-block:: javascript
195179

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+
}
200192

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::
206194

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.
211200

212201
.. _set-fcv:
213202

0 commit comments

Comments
 (0)