setFeatureCompatibilityVersion

On this page本页内容

Definition定义

setFeatureCompatibilityVersion

Enables or disables the features that persist data incompatible with earlier versions of MongoDB. 启用或禁用持久化与早期版本MongoDB不兼容的数据的功能。You can only issue the setFeatureCompatibilityVersion against the admin database.您只能针对admin数据库发出setFeatureCompatibilityVersion

Syntax语法

The command takes the following form:该命令采用以下形式:

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

The values for the version are:version的值为:

VersionDescription描述
"5.0"

Available on MongoDB 5.0 Deployments可用于MongoDB 5.0部署

Enables the 5.0 features that persist data incompatible with MongoDB 4.4.启用5.0功能,保留与MongoDB 4.4不兼容的数据

Enabling these 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 these 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.当您确信降级的可能性很小时,请启用这些功能。

"4.4"

Available on MongoDB 4.4 and 5.0 Deployments可用于MongoDB 4.4和5.0部署

Enables the 4.4 features that persist data incompatible with MongoDB 4.2.启用保留与MongoDB 4.2不兼容的数据的4.4功能

Enabling these 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 these 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.当您确信降级的可能性很小时,请启用这些功能。

"4.2"

Available on MongoDB 4.2 and 4.4 Deployments可用于MongoDB 4.2和4.4部署

Enables the 4.2 features that persist data incompatible with MongoDB 4.0.启用4.2功能,以保持与MongoDB 4.0不兼容的数据

Enabling these 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 these 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.当您确信降级的可能性很小时,请启用这些功能。

"4.0"

Available on MongoDB 4.0 and 4.2 Deployments可用于MongoDB 4.0和4.2部署

  • If set on MongoDB 4.0 deployments,如果在MongoDB 4.0部署上设置,

    Enables the 4.0 features that persist data incompatible with MongoDB 3.6.启用保留与MongoDB 3.6不兼容的数据的4.0功能

    Enabling these 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 these 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.当您确信降级的可能性很小时,请启用这些功能。

  • If set on MongoDB 4.2 deployments,如果在MongoDB 4.2部署上设置,
    Disables the 4.2 features that persist data incompatible with MongoDB 4.0.禁用保存与MongoDB 4.0不兼容数据的4.2功能
"3.6"

Available on MongoDB 3.6 and 4.0 Deployments可用于MongoDB 3.6和4.0部署

  • If set on MongoDB 3.6 deployments,如果在MongoDB 3.6部署上设置,

    Enables the 3.6 features that persist data incompatible with MongoDB 3.4.启用保存与MongoDB 3.4不兼容的数据的3.6功能

    Enabling these 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 these 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.当您确信降级的可能性很小时,请启用这些功能。

  • If set on MongoDB 4.0 deployments,如果在MongoDB 4.0部署上设置,
    Disables the 4.0 features that persist data incompatible with MongoDB 3.6.禁用保留与MongoDB 3.6不兼容数据的4.0功能
"3.4"

Available on MongoDB 3.4 and MongoDB 3.6 Deployments可用于MongoDB 3.4和MongoDB 3.6部署

"3.2"

Available on MongoDB 3.4 Deployments可用于MongoDB 3.4部署

Disables the 3.4 features that persist data incompatible with MongoDB 3.2.禁用保存与MongoDB 3.2不兼容的数据的3.4功能

The optional writeConcern specifies the write concern wtimeout value in milliseconds:可选的writeConcern指定以毫秒为单位的写入关注wtimeout值:

  • The time period that the primary waits for acknowledgment from the majority of the replica set members. primary等待大多数副本集成员确认的时间段。If the acknowledgment is not received in the time period, the operation fails.如果在该时间段内未收到确认,则操作失败。
  • Default is 60000 milliseconds. 默认值为60000毫秒。Use a longer time period if the secondary members of the replica set have a delay that exceeds the wtimeout default.如果副本集的次要成员的延迟超过wtimeout默认值,请使用更长的时间段。
Note注意
  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. 对于副本集,请在主服务器上运行命令。A majority of the data-bearing members must be available.大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。

Behavior行为

Conflicts with Background Operations与后台操作冲突

Certain background operations may prevent execution of setFeatureCompatibilityVersion. 某些后台操作可能会阻止执行setFeatureCompatibilityVersionUse currentOp to identify any ongoing operations.使用currentOp确定任何正在进行的操作。

Default Values默认值

Deployments部署featureCompatibilityVersion
For new 5.0 deployments对于新的5.0部署"5.0"
For 5.0 deployments upgraded from 4.4对于从4.4升级的5.0部署"4.4" until you setFeatureCompatibilityVersion to "5.0".“4.4”,直到将setFeatureCompatibilityVersion设置为“5.0”。
For new 4.4 deployments对于新的4.4部署"4.4"
For 4.4 deployments upgraded from 4.2对于从4.2升级的4.4部署"4.2" until you setFeatureCompatibilityVersion to "4.4".“4.2”,直到将setFeatureCompatibilityVersion设置为“4.4”。
For new 4.2 deployments对于新的4.2部署"4.2"
For 4.2 deployments upgraded from 4.0对于从4.0升级的4.2部署"4.0" until you setFeatureCompatibilityVersion to "4.2".“4.0”,直到将setFeatureCompatibilityVersion设置为“4.2”。
For new 4.0 deployments对于新的4.0部署"4.0"
For 4.0 deployments upgraded from 3.6对于从3.6升级的4.0部署"3.6" until you setFeatureCompatibilityVersion to "4.0".“3.6”,直到将setFeatureCompatibilityVersion设置为“4.0”。
For new 3.6 deployments对于新的3.6部署"3.6"
For 3.6 deployments upgraded from 3.4对于从3.4升级的3.6部署"3.4" until you setFeatureCompatibilityVersion to "3.6". “3.4”,直到将setFeatureCompatibilityVersion设置为“3.6”。
For new 3.4 deployments对于新的3.4部署"3.4"
For 3.4 deployments upgraded from 3.2对于从3.2升级的3.4部署"3.2" until you setFeatureCompatibilityVersion to "3.4". “3.2”,直到将setFeatureCompatibilityVersion设置为“3.4”。

Idempotency等时性

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.如果由于任何原因命令没有成功完成,您可以安全地重试该命令,因为操作是幂等的。

Examples示例

View FeatureCompatibilityVersion

To view the featureCompatibilityVersion for a mongod instance, run the following command on a mongod instance:要查看mongod实例的featureCompatibilityVersion,请在mongod示例上运行以下命令:

Note注意

The operation is undefined on the mongos instances. 该操作在mongos实例上未定义。For a sharded cluster that has access control enabled, to run the command against a member of the shard replica set, you must connect to the member as a shard local user.对于启用了访问控制的分片集群,要对分片副本集的成员运行命令,必须以分片本地用户的身份连接到该成员。

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

The output from this command will resemble one of the following, depending on the current state of the mongod:根据mongod的当前状态,该命令的输出将类似于以下之一:

  • If the deployment has the default featureCompatibilityVersion, or if the setFeatureCompatibilityVersion command has run successfully against the deployment, the featureCompatibilityVersion has the form:如果部署具有默认的featureCompatibilityVersion,或者如果setFeatureCompatibilityVersion命令已针对部署成功运行,则featureCompatibilityVersion的格式为:

    "featureCompatibilityVersion" : {
       "version" : <version>
    }
  • If the mongod is in a partially upgraded or downgraded state, the featureCompatibilityVersion has the following form:如果mongod处于部分升级或降级状态,featureCompatibilityVersion的格式如下:

    "featureCompatibilityVersion" : {
       "version" : <version> ,
       "targetVersion" : <target version>
    }

    For instance, if a sharded cluster has a shard replica set that is read only when you run setFeatureCompatibilityVersion command against the mongos, the command will fail, and the featureCompatibilityVersion of the config servers will include the targetVersion field.例如,如果一个分片集群的分片副本集在对mongos运行setFeatureCompatibilityVersion命令时是只读的,那么该命令将失败,并且配置服务器的featureCompatibilicyVersion将包含targetVersion字段。

    Or if a replica set becomes read only while setFeatureCompatibilityVersion is running, the command will fail, and the featureCompatibilityVersion of the replica set will include the targetVersion field as well.或者,如果副本集在setFeatureCompatibilityVersion运行时变为只读,则命令将失败,副本集的featureCompatibilityVersion也将包含targetVersion字段。

Set Feature Compatibility Version on MongoDB 5.0 Deployments在MongoDB 5.0部署上设置功能兼容性版本

Enable 5.0 Backwards Incompatible Features启用5.0向后不兼容功能

To enable the 5.0 features that persist data incompatible with MongoDB 4.4, set the feature compatibility to "5.0" on the MongoDB 5.0 deployment:要启用保持与MongoDB 4.4不兼容数据的5.0功能,请在MongoDB 5.0部署中将功能兼容性设置为"5.0"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. 对于副本集,请在主服务器上运行命令。A majority of the data-bearing members must be available.大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } )

Disable 5.0 Backwards Incompatible Features禁用5.0向后不兼容功能

To disable the 5.0 features that persist data incompatible with MongoDB 4.4, set the feature compatibility to "4.4" on the MongoDB 5.0 deployment:要禁用保持与MongoDB 4.4不兼容数据的5.0功能,请在MongoDB 5.0部署中将功能兼容性设置为"4.4"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
  • "4.4" featureCompatibilityVersion is supported on MongoDB 4.4 and MongoDB 5.0 deployments only.仅MongoDB 4.4和MongoDB 5.0部署支持"4.4"featureCompatibilityVersion。
db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )

If run as part of the downgrade process from MongoDB 5.0 to MongoDB 4.4, you must also remove all persisted features that are incompatible with 4.4. 如果作为从MongoDB 5.0降级到MongoDB 4.4的过程的一部分运行,则还必须删除所有与4.4不兼容的持久化功能。See the appropriate downgrade procedures.请参阅相应的降级程序。

Set Feature Compatibility Version on MongoDB 4.4 Deployments在MongoDB 4.4部署上设置功能兼容性版本

Enable 4.4 Backwards Incompatible Features启用4.4向后不兼容功能

To enable the 4.4 features that persist data incompatible with MongoDB 4.2, set the feature compatibility to "4.4" on the MongoDB 4.4 deployment:要启用保留与MongoDB 4.2不兼容数据的4.4功能,请在MongoDB 4.4部署中将功能兼容性设置为"4.4"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )

Disable 4.4 Backwards Incompatible Features禁用4.4向后不兼容功能

To disable the 4.4 features that persist data incompatible with MongoDB 4.2, set the feature compatibility to "4.2" on the MongoDB 4.4 deployment:要禁用保留与MongoDB 4.2不兼容数据的4.4功能,请在MongoDB 4.4部署中将功能兼容性设置为"4.2"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. 对于副本集,请在主服务器上运行命令。A majority of the data-bearing members must be available.大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
  • "4.2" featureCompatibilityVersion is supported on MongoDB 4.2 and MongoDB 4.4 deployments only.仅MongoDB 4.2和MongoDB 4.4部署支持"4.2"featureCompatibilityVersion。
db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )

If run as part of the downgrade process from MongoDB 4.4 to MongoDB 4.2, you must also remove all persisted features that are incompatible with 4.2. See the appropriate downgrade procedures.如果作为从MongoDB 4.4降级到MongoDB 4.2的过程的一部分运行,则还必须删除与4.2不兼容的所有持久化功能。请参阅相应的降级程序。

Set Feature Compatibility Version on MongoDB 4.2 Deployments在MongoDB 4.2部署上设置功能兼容性版本

Enable 4.2 Backwards Incompatible Features启用4.2向后不兼容功能

To enable the 4.2 features that persist data incompatible with MongoDB 4.0, set the feature compatibility to "4.2" on the MongoDB 4.2 deployment:要启用与MongoDB 4.0不兼容的4.2功能,请在MongoDB 4.2部署中将功能兼容性设置为“4.2”:

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( { setFeatureCompatibilityVersion: "4.2" } )

Disable 4.2 Backwards Incompatible Features禁用4.2向后不兼容功能

To disable the 4.2 features that persist data incompatible with MongoDB 4.0, set the feature compatibility to "4.0" on the MongoDB 4.2 deployment:要禁用保存与MongoDB 4.0不兼容数据的4.2功能,请在MongoDB 4.2部署中将功能兼容性设置为“4.0”:

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. 对于副本集,请在主服务器上运行命令。A majority of the data-bearing members must be available.大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
  • "4.0" featureCompatibilityVersion is supported on MongoDB 4.0 and MongoDB 4.2 deployments only.仅MongoDB 4.0和MongoDB 4.2部署支持"4.0"featureCompatibilityVersion。
db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )

If run as part of the downgrade process from MongoDB 4.2 to MongoDB 4.0, you must also remove all persisted features that are incompatible with 4.0. 如果作为从MongoDB 4.2降级到MongoDB 4.0的过程的一部分运行,则还必须删除所有与4.0不兼容的持久化功能。See the appropriate downgrade procedures.请参阅相应的降级程序。

Set Feature Compatibility Version on MongoDB 4.0 Deployments在MongoDB 4.0部署上设置功能兼容性版本

Enable 4.0 Backwards Incompatible Features启用4.0向后不兼容功能

To enable the 4.0 features that persist data incompatible with MongoDB 3.6, set the feature compatibility to "4.0" on the MongoDB 4.0 deployment:要启用保持与MongoDB 3.6不兼容数据的4.0功能,请在MongoDB 4.0部署中将功能兼容性设置为"4.0"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.adnub数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( { setFeatureCompatibilityVersion: "4.0" } )

Disable 4.0 Backwards Incompatible Features禁用4.0向后不兼容功能

To disable the 4.0 features that persist data incompatible with MongoDB 3.6, set the feature compatibility to "3.6" on the MongoDB 4.0 deployment:要禁用保持与MongoDB 3.6不兼容数据的4.0功能,请在MongoDB 4.0部署中将功能兼容性设置为“3.6”:

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
  • "3.6" featureCompatibilityVersion is supported on MongoDB 3.6 and MongoDB 4.0 Deployments Only.仅MongoDB 3.6和MongoDB 4.0 Deployments支持"3.6"featureCompatibilityVersion。
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )

If run as part of the downgrade process from MongoDB 4.0 to MongoDB 3.6, you must also remove all persisted features that are incompatible with 3.6. See the appropriate downgrade procedures.如果作为从MongoDB 4.0到MongoDB 3.6的降级过程的一部分运行,则还必须删除与3.6不兼容的所有持久化功能。请参阅相应的降级程序。

Set Feature Compatibility Version on MongoDB 3.6 Deployments在MongoDB 3.6部署上设置功能兼容性版本

Enable 3.6 Backwards Incompatible Features启用3.6向后不兼容功能

To enable the 3.6 features that persist data incompatible with MongoDB 3.4, set the feature compatibility to "3.6" on the MongoDB 3.6 deployment:要启用保留与MongoDB 3.4不兼容数据的3.6功能,请在MongoDB 3.6部署中将功能兼容性设置为“3.6”:

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )

Disable 3.6 Backwards Incompatible Features禁用3.6向后不兼容功能

To disable the 3.6 features that persist data incompatible with MongoDB 3.4, set the feature compatibility to "3.4" on the MongoDB 3.6 deployment:要禁用保留与MongoDB 3.4不兼容数据的3.6功能,请在MongoDB 3.6部署中将功能兼容性设置为"3.4"

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. A majority of the data-bearing members must be available.对于副本集,请在主服务器上运行命令。大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
  • "3.4" featureCompatibilityVersion is supported on MongoDB 3.6 and MongoDB 3.4 Deployments Only.仅MongoDB 3.6和MongoDB 3.4 Deployments支持"3.4"featureCompatibilityVersion。
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )

If run as part of the downgrade process from MongoDB 3.6 to MongoDB 3.4, you must also remove all persisted features that are incompatible with 3.4. See the appropriate downgrade procedures.如果作为从MongoDB 3.6降级到MongoDB 3.4的过程的一部分运行,则还必须删除与3.4不兼容的所有持久化功能。请参阅相应的降级程序。

Set Write Concern Timeout设置写入问题超时

The following example sets the optional write concern wtimeout field to 5000 (5 seconds).以下示例将可选的写入问题wtimeout字段设置为5000(5秒)。

Note注意

Run the setFeatureCompatibilityVersion command against the admin database.admin数据库运行setFeatureCompatibilityVersion命令。

  • For a standalone, run the command on the standalone mongod instance.对于单机版,在单机版mongod实例上运行命令。
  • For a replica set, run the command on the primary. 对于副本集,请在主服务器上运行命令。A majority of the data-bearing members must be available.大多数数据承载成员必须可用。
  • For a sharded cluster, run the command on a mongos instance.对于分片集群,在mongos实例上运行该命令。
db.adminCommand( {
   setFeatureCompatibilityVersion: "5.0",
   writeConcern: { wtimeout: 5000 }
} )
←  setAuditConfigsetIndexCommitQuorum →