Upgrade Driver Versions
On this page
Overview
This page describes the changes you must make to your application when you upgrade to a new version of the C++ driver.
Before you upgrade, perform the following actions:
Ensure the new C++ driver version is compatible with the MongoDB Server versions your application connects to and the C++ standard version your application compiles with. For version compatibility information, see the C++ driver Compatibility page.
Address any breaking changes between the driver version your application is using and your planned upgrade version in the Breaking Changes section.
Tip
To ensure compatibility across MongoDB Server versions when upgrading driver versions, use the Stable API.
Breaking Changes
Note
The C++ driver follows semantic versioning. The driver may break build system or package compatibility in any release. Patch releases may revert accidental API breaking changes.
For more information, see API and ABI Versioning.
A breaking change is a change of a convention or a behavior starting in a specific version of the driver. This type of change may prevent your application from working properly if not addressed before upgrading the driver.
The breaking changes in this section are categorized by the driver version that introduced them. When upgrading driver versions, address all the breaking changes between the current and upgrade versions.
Example
Upgrading from Version 3.0
If you're upgrading the C++ driver from version 3.0 to version 3.10, address all breaking changes listed for versions 3.1 to 3.10, if any.
Version 3.11 Breaking Changes
Drops support for MongoDB Server v3.6.
Requires MongoDB C Driver v1.28.0 or later.
If the
ENABLE_TESTS
configuration option is set toON
, C++14 or later is required. You can opt out of the C++14 requirement by disabling tests withENABLE_TESTS=OFF
during CMake configuration.Removes export of the following private member functions in the bsoncxx ABI:
bsoncxx::v_noabi::types::bson_value::value::value(const uint8_t*, uint32_t, uint32_t, uint32_t) bsoncxx::v_noabi::types::bson_value::view::_init(void*) bsoncxx::v_noabi::types::bson_value::view::view(const uint8_t*, uint32_t, uint32_t, uint32_t) bsoncxx::v_noabi::types::bson_value::view::view(void*) Removes export of the following private member functions in the mongocxx ABI:
mongocxx::v_noabi::options::change_stream::as_bson() mongocxx::v_noabi::options::aggregate::append(bsoncxx::v_noabi::builder::basic::document&) mongocxx::v_noabi::options::index::storage_options() Declare all exported functions symbols with
__cdecl
when compiled with MSVC. This is an ABI breaking change if you use an alternative default calling convention when building projects.
Version 3.10 Breaking Changes
This driver version introduces the following breaking changes:
Drops support for
find_package(libbsoncxx)
andfind_package(libmongocxx)
. Usefind_package(bsoncxx)
andfind_package(mongocxx)
instead.Drops support for the
LIBBSONCXX_*
andLIBMONGOCXX_*
CMake variables provided by the legacy CMake package config files. Use themongo::bsoncxx_*
andmongo::mongocxx_*
CMake targets instead.Removes the experimental C++ standard library (
BSONCXX_POLY_USE_STD_EXPERIMENTAL
) as a polyfill option.
Version 3.9 Breaking Changes
This driver version introduces the following breaking changes:
Removes support for exported targets from the CMake project build tree
Drops support for macOS 10.14, macOS 10.15, and Ubuntu 14.04
Requires MongoDB C Driver v1.25.0 or later
Requires CMake v3.15 or later
Version 3.8 and Earlier
For driver versions 3.8 and earlier, see the release notes and associated JIRA tickets for each release on GitHub.