A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/v6.0/reference/command/setFeatureCompatibilityVersion/ below:

setFeatureCompatibilityVersion (database command) - Database Manual v6.0

setFeatureCompatibilityVersion

Enables or disables the features that persist data incompatible with earlier versions of MongoDB. You can only issue the setFeatureCompatibilityVersion against the admin database.

Warning

Enabling backwards-incompatible features can complicate the downgrade process since you must remove any persisted backwards-incompatible features before you downgrade.

It is recommended that after upgrading, you allow your deployment to run without enabling backwards-incompatible features for a burn-in period to ensure the likelihood of downgrade is minimal. When you are confident that the likelihood of downgrade is minimal, enable these features.

This command is available in deployments hosted in the following environments:

The command has the following syntax:

db.adminCommand(   {     setFeatureCompatibilityVersion: <version>,     writeConcern: { wtimeout: <timeout> }   })

The possible values for version are:

The optional writeConcern specifies the write concern wtimeout value in milliseconds:

Note

Certain background operations may prevent execution of setFeatureCompatibilityVersion. Use currentOp to identify any ongoing operations.

If you trigger a setFeatureCompatibilityVersion change during an initial sync, the sync may fail with an OplogOperationUnsupported error message when replaying entries on the oplog application phase. The sync following this attempt succeeds because the operation phase no longer replays the operation.

This command must perform writes to an internal system collection. If for any reason the command does not complete successfully, you can safely retry the command as the operation is idempotent.

Starting in MongoDB 6.0, if you need to downgrade the feature compatibility version, ensure you disable cluster-to-cluster replication and user write blocking.

  1. If you enabled cluster-to-cluster replication, disable it.

  2. If you enabled user write blocking, disable it:

    db.runCommand( { setUserWriteBlockMode: 1, global: false } )
  3. Wait for the previous command to complete.

  4. Downgrade the feature compatibility version using setFeatureCompatibilityVersion.

For more information on MongoDB Cluster-to-Cluster Sync, see the documentation.

Arbiters do not replicate the admin.system.version collection. Because of this, arbiters always have a feature compatibility version equal to the downgrade version of the binary, regardless of the FCV value of the replica set.

For example, an arbiter in a MongoDB 5.0 cluster, has an FCV value of 4.4.

To view the featureCompatibilityVersion for a mongod instance, run the getParameter command on a mongod instance:

db.adminCommand( {                    getParameter: 1,                    featureCompatibilityVersion: 1                 }               )

The output resembles:

{  featureCompatibilityVersion: { version: '5.0' },  ok: 1,  '$clusterTime': {    clusterTime: Timestamp({ t: 1660318752, i: 5 }),    signature: {      hash: Binary(Buffer.from("ce0cff3621e9b089fa6d8e9a1e1efc1a1ff15dab", "hex"), 0),      keyId: Long("7129893797260951557")    }  },  operationTime: Timestamp({ t: 1660318752, i: 5 })}
Note

The operation is undefined on the mongos instances.

On a sharded cluster that has access control enabled, you must connect to the shard as a shard local user to run the command.

To enable the 6.0 features that persist data incompatible with MongoDB 5.0, set the feature compatibility to "6.0" on the MongoDB 6.0 deployment:

Note

Run the setFeatureCompatibilityVersion command against the admin database.

db.adminCommand( { setFeatureCompatibilityVersion: "6.0" } )

To disable the 6.0 features that persist data incompatible with MongoDB 5.0, set the feature compatibility to "5.0" on the MongoDB 6.0 deployment:

Note

Run the setFeatureCompatibilityVersion command against the admin database.

db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )

If run as part of the downgrade process from MongoDB 6.0 to MongoDB 5.0, you must also remove all persisted features that are incompatible with 5.0. See the appropriate downgrade procedures.

The following example sets the optional write concern wtimeout field to 5000 (5 seconds).

Note

Run the setFeatureCompatibilityVersion command against the admin database.

db.adminCommand( {   setFeatureCompatibilityVersion: "5.0",   writeConcern: { wtimeout: 5000 }} )

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4