Docs Menu
Docs Home
/ / /
C++ Driver

Upgrade Driver Versions

On this page

  • Overview
  • Breaking Changes

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.

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.

  • Drops support for MongoDB Server v3.6.

  • Requires MongoDB C Driver v1.28.0 or later.

  • If the ENABLE_TESTS configuration option is set to ON, C++14 or later is required. You can opt out of the C++14 requirement by disabling tests with ENABLE_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.

This driver version introduces the following breaking changes:

  • Drops support for find_package(libbsoncxx) and find_package(libmongocxx). Use find_package(bsoncxx) and find_package(mongocxx) instead.

  • Drops support for the LIBBSONCXX_* and LIBMONGOCXX_* CMake variables provided by the legacy CMake package config files. Use the mongo::bsoncxx_* and mongo::mongocxx_* CMake targets instead.

  • Removes the experimental C++ standard library (BSONCXX_POLY_USE_STD_EXPERIMENTAL) as a polyfill option.

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

For driver versions 3.8 and earlier, see the release notes and associated JIRA tickets for each release on GitHub.

Back

What's New