How to View your featureCompatibilityVersion in MongoDB

The example on this page demonstrates how to view the featureCompatibilityVersion for a mongod instance.

Example

Here’s an example of the code used to view the featureCompatibilityVersion for a mongod instance:

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

Example result:

{ "featureCompatibilityVersion" : { "version" : "4.4" }, "ok" : 1 }

I ran that on a MongoDB 4.4.1 installation, which has a featureCompatibilityVersion of 4.4. The actual format of the result depends on the MongoDB version.

For example, in MongoDB 3.4 it goes like this:

"featureCompatibilityVersion" : <version>

The featureCompatibilityVersion setting determines the features that persist data incompatible with earlier versions of MongoDB. This setting can be set with the setFeatureCompatibilityVersion command.

For new MongoDB deployments, the featureCompatibilityVersion is usually the same as that version. For example, my MongoDB 4.4.1 instance returns a featureCompatibilityVersion of 4.4.

When you upgrade to a new version of MongoDB, your featureCompatibilityVersion will typically remain at its original value until you explicitly upgrade it with setFeatureCompatibilityVersion.

MongoDB Documentation

For more information, see the MongoDB documentation.