Skip to main content
Version: 7.0

Feature Compatibility Version (FCV)

Overview

Feature Compatibility Version (FCV) defines which MongoDB features are enabled. It’s stored in the admin.system.version collection and defaults to the version the database was first deployed on.

FCV allows a replica set to temporarily operate in compatibility mode with an older MongoDB version, even after upgrading the binary files. This provides the ability to upgrade replica set nodes step by step without requiring downtime.

danger

Note: FCV supports only one previous version. For example, MongoDB 7.0 can have FCV set to "6.0" or "7.0", but not "5.0". Therefore, upgrades must be performed step by step: 6.0 → 7.0, then 7.0 → 8.0, and so on.

For standalone MongoDB instances, FCV does not play a significant role — upgrades are performed directly without considering FCV.

Check and Configure FCV Parameter

danger

Before performing any operations that may affect MongoDB, you must create your database backup. Without database backup, data recovery may be impossible, and our support team will not be able to assist in case of failure or unexpected interruption.
Backups creation and restoration examples

Checking FCV before upgrading:

  1. Connect to your replica set using user account with access to admin database:
mongosh "mongodb://your_admin_user:your_password@node1:27017,node2:27017,node3:27017/?replicaSet=your_replicaset_name"
  1. Get the current FCV value:
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
  1. If FCV value is lower than current MongoDB version, update it to match the version you’re using:
db.adminCommand({ setFeatureCompatibilityVersion: "7.0" })

Step-by-step upgrade procedure for replica sets

  1. Stop one secondary node, upgrade it to next major MongoDB version, and start it again.
  2. Wait until upgraded node fully synchronizes with your replica set:
rs.status()
  1. Repeat the process for the remaining secondary nodes.
  2. Step down your current primary and promote one of the upgraded secondary nodes to primary:
rs.stepDown()
  1. Make sure your former primary has become a secondary:
rs.status()
  1. Upgrade former primary node to the target version.
  2. Once all replica set members have been upgraded, raise FCV to the new version.
db.adminCommand({ setFeatureCompatibilityVersion: "7.0" })