To upgrade an existing MongoDB deployment to 4.0, you must be
running a 3.6-series release.

To upgrade from a version earlier than the 3.6-series, you must
successively upgrade major releases until you have upgraded to
3.6-series. For example, if you are running a 3.4-series, you must
upgrade first to upgrade first to 3.6before you can upgrade to 4.0.

Before beginning your upgrade, see the Compatibility Changes in MongoDB 4.0 document to
ensure that your applications and deployments are compatible with
MongoDB 4.0. Resolve the incompatibilities in your deployment before
starting the upgrade.

Before upgrading MongoDB, always test your application in a staging
environment before deploying the upgrade to your production
environment.

MongoDB drops support for the $isolated operator. If you have an
existing partial index that includes the $isolated operator or a
view that includes a $isolated operator, recreate the index or
view without the operator in the definition before upgrading.

At this point, you can run the 4.0 binaries without the
4.0 features that are incompatible with 3.6.

To enable these 4.0 features, set the feature compatibility
version (FCV) to 4.0.

Tip

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.