Overview
Learn what's new in:
Types of Breaking Changes
New versions of the C++ driver can introduce the following types of breaking changes:
API changes concern the API of the C++ driver libraries. These changes are accompanied by an API major version bump. You might need to edit C++ source code in your project to address these changes.
Example
Removes the declaration of function
v1::func(). (The definition is still provided for ABI compatibility.)Removes the inline function
v_noabi::func().Removes
v_noabi::func().Changes the redeclaration of
bsoncxx::foofromv1::footov2::foo. To continue using the old interface, qualifybsoncxx::fooasbsoncxx::v1::foo.
ABI changes concern the ABI of the C++ driver libraries. These changes are accompanied by an ABI version bump, and may also be accompanied by an API major version bump. You might need to rebuild your project or edit your C++ source code to address these changes.
ABI stability is not supported for symbols corresponding to entities declared in the
v_noabinamespace. Breaking changes for such symbols are not necessarily accompanied by an ABI version bump.Example
Removes the exported symbol
v_noabi::func().Removes the exported symbol
v1::func().Removes the exported symbols for
v1::type.
Build system changes concern the build system or packaging of the C++ driver libraries. These changes are not necessarily accompanied by either an API major version bump or an ABI version bump. To address these changes, you might need to modify your build system configurations or update your project's package or dependency management settings. You might also need to modify or rebuild your C++ source code.
Example
Removes the
ENABLE_FOOconfiguration variable.Changes the default value of the
ENABLE_BARconfiguration variable fromOFFtoON.Drops support for platform A, compiler B, or architecture C.
The release includes the following bug:
CMake might incorrectly set the API version for an auto-downloaded C driver to
0.0.0when the CMake project is configured more than once or to the same value as the C++ driver's API version whenBUILD_VERSIONis explicitly set during initial configuration. CMake will only auto-download the C driver with the C++ driver if it cannot find an existing C driver installation by usingfind_package(). This bug will be fixed in an upcoming patch release.
To learn more about this release, see the v4.0 Release Notes on GitHub.
What's New in 3.11
Warning
Breaking Changes
The v3.11 driver introduces the following breaking changes:
Drops support for MongoDB Server v3.6.
Requires MongoDB C Driver v1.28.0 or later.
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
__cdeclwhen compiled with MSVC. This is an ABI breaking change if you use an alternative default calling convention when building projects.
The v3.11 driver release includes the following new features:
Adds support for MongoDB Server v8.0.
Adds support for Queryable Encryption range queries. To use this feature, your app must connect to MongoDB Server 8.0 or later. For more information about Queryable Encryption, see Queryable Encryption in the MongoDB Server manual.
Adds
empty()member function formongocxx::v_noabi::bulk_write.
The release includes the following bug:
CMake might incorrectly set the API version for an auto-downloaded C driver to
0.0.0when the CMake project is configured more than once or to the same value as the C++ driver's API version whenBUILD_VERSIONis explicitly set during initial configuration. CMake will only auto-download the C driver with the C++ driver if it cannot find an existing C driver installation by usingfind_package(). This bug will be fixed in an upcoming patch release.
To learn more about this release, see the v3.11 Release Notes on GitHub.
What's New in 3.10
Warning
Build System Breaking Changes
The v3.10 driver introduces the following breaking changes to the build system:
Drops support for calling
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
BSONCXX_POLY_USE_STD_EXPERIMENTALCMake option and drops support for selecting the experimental C++ standard library as a polyfill option.
The v3.10.0 driver release includes the following new features:
Adds forward headers that provide non-defining declarations of
bsoncxxandmongocxxclass types. The driver does not support user-defined forward declarations of any library entity. To obtain the declaration or definition of a library entity, always include the corresponding header.The CMake option
ENABLE_BSONCXX_USE_POLY_IMPLSallows selectingbsoncxximplementations of C++17 polyfills by default when no polyfill library is requested. This option isOFFby default.The CMake option
BSONCXX_POLY_USE_IMPLSallows selectingbsoncxximplementations of C++17 polyfills instead of external libraries or the C++ standard library. This option isOFFby default.The
bsoncxx::v_noabiandmongocxx::v_noabinamespaces are no longer declared inline. Root namespace declarations are still supported and expected to remain equivalent to their prior definitions. For example,bsoncxx::documentis still equivalent tobsoncxx::v_noabi::document, andmongocxx::clientis still equivalent tomongocxx::v_noabi::client.By default, when library filenames are compiled with MSVC (as detected by CMake's
MSVCvariable), they are embedded with an ABI tag string. These strings are similar to the following:bsoncxx-v_noabi-rhs-x64-v142-md.lib To disable this behavior, set
ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES=OFFas part of your CMake configuration.The ABI tag string can also be embedded in pkg-config metadata filenames, similar to the following:
libbsoncxx-v_noabi-rhs-x64-v142-md.pc To enable this behavior, set
ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES=ONandENABLE_ABI_TAG_IN_PKGCONFIG_FILENAMES=ONas part of your CMake configuration.
To learn more about this release, see the v3.10 Release Notes on GitHub.
What's New in 3.9
Warning
Build System Breaking Changes
The v3.9 driver 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 to support the
FetchContentmodule
The v3.9 driver release includes the following new features:
The C++ driver container image is now available on Docker hub.
The driver automatically downloads the MongoDB C Driver dependency if you don't provide it.
The driver no longer builds tests as part of the
alltarget. To build tests, setBUILD_TESTING=ONas part of your CMake configuration.The driver uses the
FetchContentmodule to download and build the MNMLSTC Core polyfill library, if not provided by the system, instead of theExternalProjectmodule. It also does not patchincludedirectives in MNMLSTC Core headers.Adds the CMake option
MONGOCXX_OVERRIDE_DEFAULT_INSTALL_PREFIX. If this option is set toTRUE, theCMAKE_INSTALL_PREFIXoption defaults to the build directory. The default value of this option isTRUE.Adds an API for managing MongoDB Search indexes.
Adds the
VERSIONINFOresource tobsoncxx.dllandmongocxx.dll.Explicitly documents that throwing an exception from an APM callback is undefined behavior.
Does not prematurely install MNMLSTC Core headers during the CMake build step.
Requires that a MongoDB C Driver CMake package is found via
find_dependency()for all installed C++ driver package configurations.
To learn more about this release, see the v3.9 Release Notes on GitHub.