Overview
The MongoDB C Driver consists of two libraries: libbson and
libmongoc. On this page, you can learn about the changes,
and deprecations made in each version of the driver libraries.
Learn what's new in:
What's New in 2.1.1
The following sections describe the changes in the 2.1.1 release of the C driver.
libbson
This version is incremented to match the libmongoc version, but there
are no changes since 2.1.0.
libmongoc
The 2.1.1 release of libmongoc includes the following changes:
Fixes
No longer propagates the
-fPICflag in CMake targetsApplies write command behavior to the
mongoc_collection_create_indexes_with_opts()functionOmits the
saslSupportedMechsfield in single-threaded monitoring commands
For more information about this release, see the v2.1.1 release notes.
What's New in 2.1.0
Warning
Breaking Changes
C driver v2.1.0 contains breaking changes. For more information, see Version 2.1.0 in the Upgrade Driver Versions guide.
The following sections describe the changes in the 2.1.0 release of the C driver.
libbson
The 2.1.0 release of libbson includes the following changes:
Fixes
For non-Windows environments, the uninstall script now calls the
find "$dir" -maxdepth 1command to detect non-empty directories instead of thels --almost-allcommand, which was not supported on macOS.For Windows environments, the uninstall script no longer "succeeds" with an incorrect, non-zero
%ERRORLABEL%value.Removes support for Debian 9 and Debian 10.
Improvements
Sets CMake policy max version to
4.0. The max version was previously unset.
libmongoc
The 2.1.0 release of libmongoc includes the following changes:
Fixes
For non-Windows environments, the uninstall script now calls the
find "$dir" -maxdepth 1command to detect non-empty directories instead of thels --almost-allcommand, which was not supported on macOS.For Windows environments, the uninstall script no longer "succeeds" with an incorrect, non-zero
%ERRORLABEL%value.Adds Window Secure Channel support to verify client certificates with newer signatures.
Replaces use of
rand()with thread-safe alternatives.Removes support for Debian 9 and Debian 10.
Improvements
Updates the minimum supported MongoDB Server version from 4.0 to 4.2.
Sets CMake policy max version to
4.0. The max version was previously unset.Removes unhelpful long-lived buffers to reduce memory usage.
Improves error messages produced by Windows APIs.
What's New in 2.0.2
The following sections describe the changes in the 2.0.2 release of the C driver.
libbson
This release includes several fixes to the bson_validate family of functions,
with the following minor behavioral changes:
When you specify the
BSON_VALIDATE_UTF8setting, the driver rejects invalid UTF-8 sequences instead of accepting them as in previous versions.The driver validates the scope document in a deprecated "code with scope" element with a fixed set of rules and treats it as an opaque JavaScript object.
The driver enforces a document nesting limit during validation.
libmongoc
The 2.0.2 release of libmongoc includes the following changes:
Fixes
Fixes a message of
bson_strerror_ron Windows.Fixes memory leaks with Windows Secure Channel.
Fixes loading PKCS#8 RSA keys with Windows Secure Channel.
For more information about this release, see the v2.0.2 release notes.
What's New in 2.0.1
The following sections describe the changes in the 2.0.1 release of the C driver.
libbson
The 2.0.1 release of libbson includes the following changes:
Fixes
Fixes a CMake 4 configuration error on macOS operating systems
libmongoc
The 2.0.1 release of libmongoc includes the following changes:
Fixes
Fixes a username handling issue for
MONGODB-X509authentication that occurred when the C driver was configured to use the Secure Transport or Secure Channel libraryNo longer populates a
mongoc_bulkwritereturn_t.reswith a partial result when themongoc_bulkwrite_execute()function generates a client error after the first write operation
For more information about this release, see the v2.0.1 release notes.
What's New in 2.0.0
Warning
Breaking Changes
C driver v2.0.0 contains breaking changes. For more information, see Version 2.0.0 in the Upgrade Driver Versions guide.
The following sections describe the changes in the 2.0.0 release of the C driver.
Important
Removals
The 2.0.0 driver release removes many deprecated types and methods. To view a full list of removals, see the Removals sections of the v2.0 release notes.
libbson
The 2.0.0 release of libbson includes the following changes:
New Features
Adds support for the BSON Binary Vector subtype. To learn more, see BSON Binary Vector subtype in the libbson API documentation.
libmongoc
The 2.0.0 release of libmongoc includes the following changes:
New Features
Supports aggregate operations that include
$lookupstages for In-Use Encryption. To learn more, see the following references in the MongoDB Server manual:$lookup and $graphLookup Behavior for CSFLE
For more information about this release, see the v2.0 release notes.
What's New in 1.30.3
The following sections describe the changes in the 1.30.3 release of the C driver.
libbson
The 1.30.3 release of libbson includes the following changes:
New Features
In anticipation of the v2.0 release, adds new CMake packages and imported targets for
bsonto allow you to support both major versions without modifying your CMake project.To import
bsonwith the new names, callfind_packagefor thebsonpackage. The new imported target names arebson::static,bson::shared, andbson::bson.
libmongoc
The 1.30.3 release of libmongoc includes the following changes:
New Features
In anticipation of the v2.0 release, adds new CMake packages and imported targets for
bsonandmongocto allow you to support both major versions without modifying your CMake project.To import
mongocwith the new names, callfind_packagefor themongocpackage. The new imported target names aremongoc::static,mongoc::shared, andmongoc::mongoc.To import
bsonwith the new names, callfind_packagefor thebsonpackage. The new imported target names arebson::static,bson::shared, andbson::bson.
For more information about this release, see the v1.30.3 release notes.
What's New in 1.30.0
The following sections describe the changes in the 1.30.0 release of the C driver.
libbson
The 1.30.0 release of libbson includes the following changes:
Deprecations
Deprecates support for Debian 9 and Debian 10
Improvements
Improves the performance of BSON to JSON serialization for nested documents
Fixes
Updates the truncated output of the
bson_as_json_with_opts()function to no longer split valid UTF-8 sequencesUpdates generated JSON text in the following ways:
Serializes all empty arrays and documents with one space
Serializes arrays that the driver omits because of the maximum recursion limit to
[ ... ]instead of{ ... }Applies the maximum recursion limit to legacy CodeWScope documents
Fixes an output parameter leaked after unsuccessful calls to the
bson_append_array_builder_begin()function
libmongoc
The 1.30.0 release of libmongoc includes the following changes:
Deprecations
Deprecates support for Debian 9 and Debian 10
New Features
Adds support for structured logging. To configure this feature, use the
mongoc_client_set_structured_log_opts()andmongoc_client_pool_set_structured_log_opts()functions.Adds support for cache lifetime configuration of In-Use Encryption data encryption keys. To configure this feature, use the
mongoc_auto_encryption_opts_set_key_expiration()andmongoc_client_encryption_opts_set_key_expiration()functions.To learn more about In-Use Encryption, see In-Use Encryption in the MongoDB Server manual.
Adds support for the
sortoption for update and replace operations.Adds support for constructing a
mongoc_bulkwrite_ttype without a client by using themongoc_bulkwrite_new()andmongoc_bulkwrite_set_client()functions.
Improvements
Improves the performance of the
mongoc_server_description_new_copy()function
Fixes
Includes the following APM event fixes required by the SDAM specification:
After delivering a
server_openingevent, the driver must deliver a correspondingserver_closedevent before deliveringtopology_closedBefore delivering a
topology_closedevent, the driver delivers atopology_changedevent that has anew_descriptionof typeUnknown
Fixes possible crashes when the driver reports the inserted document IDs in the verbose results of client bulk writes
For more information about this release, see the v1.30 release notes.
What's New in 1.29.0
Warning
Breaking Changes
C driver v1.29.0 contains breaking changes. For more information, see Version 1.29.0 in the Upgrade Driver Versions guide.
The 1.29.0 release of the C driver includes several changes.
libbson
The 1.29.0 release of libbson includes the following changes:
Deprecations
Deprecates the
bson_string_tand associated functionsDeprecates compiling with
BSON_MEMCHECKDeprecates
bson_in_range_*()andbson_cmp_*()functionsDeprecates
bson_atomic_*()andbson_thrd-yield()functionsDeprecates
bson_as_json()andbson_array_as_json()functions
libmongoc
The 1.29.0 release of libmongoc includes the following changes:
Deprecations
Deprecates
mongoc_client_command. Usemongoc_client_command_simpleinstead.Deprecates
mongoc_database_command. Usemongoc_database_command_simpleinstead.Deprecates
mongoc_collection_command. Usemongoc_collection_command_simpleinstead.
For more information about this release, see the v1.29 release notes.
What's New in 1.28.0
Warning
Breaking Changes
C driver v1.28.0 contains breaking changes. For more information, see Version 1.28.0 in the Upgrade Driver Versions guide.
The 1.28.0 release of the C driver includes several changes.
libbson
The 1.28.0 release of libbson includes the following changes:
New Features
Adds
bson_validate_with_error_and_offset()function
libmongoc
New Features
Adds support for In-Use Encryption range queries
mongoc_collection_insert_oneincludes the insert IDAdds new bulk write API
mongoc_bulkwrite_tAdds
serverMonitoringModeURI option
Deprecations
Deprecates
*_hintoption. Instead, use the*_server_idoption.Deprecates
mongoc_bulk_operation_set_hint. Instead, usemongoc_bulk_operation_set_server_id.Deprecates
mongoc_bulk_operation_get_hint. Instead, usemongoc_bulk_operation_get_server_id.Deprecates
mongoc_cursor_set_hint. Instead, usemongoc_cursor_set_server_id.Deprecates
mongoc_cursor_get_hint. Instead, usemongoc_cursor_get_server_id.
Deprecates
ENABLE_SSL=LIBRESSLandmongoc_stream_tls_libressl_new.Deprecates
ENABLE_SASL=CYRUSand theCYRUS_PLUGIN_PATH_PREFIXoption on Windows platforms.
For more information about this release, see the v1.28 release notes.
What's New in 1.27.6
The 1.27.6 release of the C driver includes several changes.
libbson
The 1.27.6 release of libbson includes the following changes:
Fixes
Fixes handling of malformed extended JSON for special BSON types
libmongoc
The 1.27.6 release of libmongoc includes the following changes:
Fixes
Fixes TSan warning
Fixes C23 compile
Improvements
Documents expected behavior of command errors in a transaction
What's New in 1.27.5
The 1.27.5 release of the C driver includes several changes.
libbson
The 1.27.5 release of libbson includes the following changes:
Fixes
Fixes large string handling in
bson_append_utf8
libmongoc
The 1.27.5 release of libmongoc includes the following changes:
Fixes
Fixes possible build error in environments where
boolor_Boolis a macro
What's New in 1.27.4
The 1.27.4 release of the C driver includes several changes.
libbson
The 1.27.4 release of libbson includes the following changes:
Fixes
Fixes build issues with Visual Studio 2013
libmongoc
The 1.27.4 release of libmongoc includes the following changes:
Fixes
Fixes possible crash reading malformed wired protocol message
Fixes build issues with Visual Studio 2013
What's New in 1.27.3
The 1.27.3 release of the C driver includes several changes.
libbson
The 1.27.3 release of libbson includes the following changes:
Changes
Introduces changes surrounding the development processes, including new code signing and dependency tracking. There are no behavioral or API changes.
libmongoc
The 1.27.3 release of libmongoc includes the following changes:
Fixes
Upgrades bundled Zlib from 1.2.3 to 1.3.1
What's New in 1.27.2
The 1.27.2 release of the C driver includes several changes.
libbson
The 1.27.2 release of libbson includes the following changes:
Fixes
Fixes parsing of colon in timezone
Fixes error on failure to initialize a subdocument in
bson_iter_visit_all
libmongoc
The 1.27.2 release of libmongoc includes the following changes:
Fixes
Closes leftover connections to remote servers
New Features
Checks environment variable
MONGO_EXPERIMENTAL_SRV_PREFER_TCPto prefer TCP over SRV lookup
What's New in 1.27.1
The 1.27.1 release of the C driver includes several changes.
libbson
The 1.27.1 release of libbson includes the following changes:
Fixes
Fixes large string handling in
bson_string_newandbson_string_append
libmongoc
This version is incremented to match the libbson version, but there are no changes since 1.27.0.
What's New in 1.27.0
Warning
Breaking Changes
C driver v1.27.0 contains breaking changes. For more information, see Version 1.27.0 in the Upgrade Driver Versions guide.
The 1.27.0 release of the C driver includes several changes.
libbson
This version is incremented to match the libbson version, but there are no changes since 1.26.2.
libmongoc
The 1.27.0 release of libmongoc includes the following changes:
Fixes
Fixes possible crash when client is configured with an empty password
New Features
Adds database name to command events
mongoc_apm_command_failed_get_database_nameandmongoc_apm_command_succeeded_get_database_nameSupports delegated KMIP protocol for In-Use Encryption
Enables setting socket timeout per client
What's New in 1.26.2
Warning
Breaking Changes
C driver v1.26.2 contains breaking changes. For more information, see Version 1.26.2 in the Upgrade Driver Versions guide.
The 1.26.2 release of the C driver includes several changes.
libbson
The 1.26.2 release of libbson includes the following changes:
Fixes
Fixes iteration on
bson_strfreev
libmongoc
The 1.26.2 release of libmongoc includes the following changes:
Fixes
Fixes possible hang if
mongoc_gridfs_file_readvis called with a corrupt chunk with incomplete dataFixes assert with legacy exhaust cursor protocol when connected to MongoDB server versions earlier than 4.2
What's New in 1.26.1
The 1.26.1 release of the C driver includes several changes.
libbson
The 1.26.1 release of libbson includes the following changes:
Fixes
Uses aligned allocation for
bson_array_builder_t
libmongoc
The 1.26.1 release of libmongoc includes the following changes:
Fixes
Fixes 32-bit compile with 64-bit
time_t
What's New in 1.26.0
The 1.26.0 release of the C driver includes several changes.
libbson
This version is incremented to match the libmongoc version, but there are no changes since 1.25.4.
libmongoc
The 1.26.0 release of libmongoc includes the following changes:
New Features
Supports named KMS providers
Redirects retries in sharded clusters to another mongos if possible
Improvements
Adds
VERSION_CURRENTfile in source to ease buildingConsiders more errors retryable