Skip to content

Releases: mongodb/mongo-c-driver

mongo-c-driver 1.30.3

08 Apr 12:00
1.30.3
80fa63e
Compare
Choose a tag to compare

Announcing 1.30.3 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Fixes:

  • Fix CMake configure error on macOS with CMake 4.

New Features:

  • In anticipation of the 2.0 release of mongo-c-driver, new CMake packages and
    imported targets have been defined (for both bson and mongoc). To import
    bson with the new names, call find_package for the bson package. The new
    imported targets are named bson::static, bson::shared, and bson::bson
    (which points to either the static or the shared library, depending on an
    import-time configuration option).

    The new package and target names will remain unchanged when upgrading to the
    2.0 release, allowing consumers to support both major versions without
    modifying their CMake project. The current imported target names will be
    removed from the 2.0 release, and should not be used for
    forward-compatibility.

libmongoc

New Features:

  • In anticipation of the 2.0 release of mongo-c-driver, new CMake packages and
    imported targets have been defined (for both bson and mongoc). To import
    mongoc with the new names, call find_package for the mongoc package. The
    new imported targets are named mongoc::static, mongoc::shared, and
    mongoc::mongoc (which points to either the static or the shared library,
    depending on an import-time configuration option).

    The new package and target names will remain unchanged when upgrading to the
    2.0 release, allowing consumers to support both major versions without
    modifying their CMake project. The current imported target names will be
    removed from the 2.0 release, and should not be used for
    forward-compatibility.

    Programs that link to BSON libraries directly should also use the new target
    names bson::static, bson::shared, or bson::bson.

Links:

Thanks to everyone who contributed to this release.

  • Kevin Albertson
  • Ezra Chung
  • Colby Pike

mongo-c-driver 2.0.0

01 Apr 14:17
2.0.0
67817df
Compare
Choose a tag to compare

Announcing 2.0.0 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

New Features

  • Add support for BSON Binary Vector.

Changes

  • BSON_ERROR_BUFFER_SIZE is reduced from 504 to 503 to reserve the final byte for internal use.
    • The data layout of bson_error_t remains otherwise unchanged: the size is still 512 bytes and the offset of the .code, .domain, and .message data members remain unchanged.
  • The pkg-config files libbson-1.0 and libbson-static-1.0 have been renamed to bson2, and bson2-static, respectively.

CMake Packages and Imported Targets

The bson-1.0 CMake package has been removed. Instead, use or bson, and
specify a version or version range to be imported:

find_package(bson 1.30...2.0)

The new package imports different target names:

  • mongo::bson_staticbson::static
  • mongo::bson_sharedbson::shared
  • The target bson::bson is a shim target that points to either the shared library or the static library.

Removals

  • bson_as_json and bson_array_as_json are removed due to producing non-portable Legacy Extended JSON. Prefer Canonical Extended JSON or Relaxed Extended JSON for portability. To continue using Legacy Extended JSON, use bson_as_legacy_extended_json and bson_array_as_legacy_extended_json.
  • Compiling with BSON_MEMCHECK defined now has no effect.
  • Remove deprecated integral comparison interfaces: bson_in_range_* and bson_cmp_*.
  • Remove deprecated atomic and threading interfaces: bson_atomic_* and bson_thrd_yield.
  • The deprecated ENABLE_EXTRA_ALIGNMENT CMake option is removed.
    • bson_t and bson_iter_t are now aligned to the size of a pointer instead of 128.
    • bson_error_t, bson_value_t, and bson_visitor_t are now aligned to the size of a pointer instead of 8.
    • BSON_ALIGNED_BEGIN and BSON_ALIGNED_END now unconditionally apply their requested alignment.
  • Remove deprecated bson_copy_to_excluding. Use bson_copy_to_excluding_noinit instead.

libmongoc

New Features

  • Support aggregate operations with $lookup stage for In-Use Encryption.

Notes

  • In a future minor release the minimum supported MongoDB Server version will be raised from 4.0 to 4.2. This is in accordance with MongoDB Software Lifecycle Schedules.
  • Raise required version of libmongocrypt to 1.13.0 to support In-Use Encryption (corresponds to the CMake option: ENABLE_CLIENT_SIDE_ENCRYPTION).

Changes

  • Passing batchSize:0 as an option to mongoc_client_watch, mongoc_database_watch, or mongoc_collection_watch
    now applies batchSize:0 to the aggregate command. Useful to request an immediate cursor. Previously the value
    was ignored.
  • bson_oid_init_sequence is removed. Use bson_oid_init instead.
  • mongoc_server_description_host changes the return type from mongoc_host_list_t * to const mongoc_host_list_t *.
  • URI authentication credentials validation (only applicable during creation of a new mongoc_uri_t object from a connection string):
    • The requirement that a username is non-empty when specified is now enforced regardless of authentication mechanism.
    • Username and password specification requirements are now validated and returns a client error for the specified authentication mechanism.
      • e.g. it is a client error to not specify a username or a password for SCRAM-SHA-1, SCRAM-SHA-256, and PLAIN.
      • e.g. it is a client error to specify a password for MONGODB-X509.
      • e.g. it is a client error to specify a username or a password without the other for MONGODB-AWS.
    • authSource is now correctly defaulted to "$external" for MONGODB-AWS (instead of the database name or "admin").
    • authMechanism is now validated and returns a client error for invalid or unsupported values.
    • authMechanismProperties is now validated and returns a client error for invalid or unsupported properties for the specified authentication mechanism.
    • authMechanismProperties now correctly supports ':' within property values.
      • Old behavior: authMechanismProperties=A:B,C:D:E,F:G is parsed as {'A': 'B', 'C': 'D:E,F:G'}.
      • New behavior: authMechanismProperties=A:B,C:D:E,F:G is parsed as {'A': 'B': 'C': 'D:E', 'F': 'G'}.
  • Calling mongoc_bulk_operation_execute on the same mongoc_bulk_operation_t repeatedly is an error. Previously this was only discouraged in documentation.
  • Consistently apply __cdecl calling convention to function declarations in public API. Intended to support consumers building their code using a different default calling convention with MSVC. The mongoc and bson libraries only support being built with the __cdecl default calling convention.
  • mongoc_client_set_ssl_opts now ignores a pooled mongoc_client_t and logs an error. Use mongoc_client_pool_set_ssl_opts to set TLS options on a mongoc_client_pool_t before popping any clients.
  • mongoc_client_set_ssl_stream_initiator now ignores a pooled mongoc_client_t and logs an error.
  • The pkg-config files libmongoc-1.0, libmongoc-static-1.0, libbson-1.0, and libbson-static-1.0 have been renamed to mongoc2, mongoc2-static, bson2, and bson2-static, respectively.

CMake Packages and Imported Targets

The mongoc-1.0 (and bson-1.0) CMake packages have been removed. Instead, use
mongoc or bson, and specify a version or version range to be imported:

find_package(mongoc 1.30...2.0)

The new packages import different target names:

  • mongo::mongoc_staticmongoc::static
  • mongo::mongoc_sharedmongoc::shared
  • The target mongoc::mongoc is a shim target that points to either the shared library or the static library.

The BSON library has had similar name changes.

Removals

  • The bson_md5_t struct and associated API is removed.
  • The client side matching feature, mongoc_matcher_t and related functions are removed.
  • mongoc_server_description_ismaster is removed. Use the equivalent mongoc_server_description_hello instead.
  • MONGOC_QUERY_SLAVE_OK is removed. Use the equivalent MONGOC_QUERY_SECONDARY_OK instead.
  • MONGOC_URI_SLAVEOK is removed. It was unused.
  • mongoc_client_command, mongoc_database_command, and mongoc_collection_command are removed. Use mongoc_client_command_simple, mongoc_database_command_simple, and mongoc_collection_command_simple instead.
  • MONGOC_URI_MAXIDLETIMEMS and MONGOC_URI_WAITQUEUEMULTIPLE are removed. They were unused.
  • bson_string_t and associated functions are removed.
  • Support for ENABLE_SASL=CYRUS on Windows is removed. Use ENABLE_SASL=SSPI or ENABLE_SASL=OFF instead.
    • The associated Windows-only option CYRUS_PLUGIN_PATH_PREFIX is removed.
  • Support for the deprecated minPoolSize URI option is removed along with associated API: MONGOC_URI_MINPOOLSIZE and mongoc_client_pool_min_size.
  • Support for LibreSSL (the CMake option ENABLE_SSL=LIBRESSL) is removed. Associated API is removed (MONGOC_ENABLE_SSL_LIBRESSL and mongoc_stream_tls_libressl_new).
  • MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED (value -1) is removed. Use MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED (value 0) which is handled equivalently. If specified in a URI, replace: mongodb://host/?w=-1 with mongodb://host/?w=0.
  • The deprecated CMake option ENABLE_AUTOMATIC_INIT_AND_CLEANUP is removed. See Initialization and cleanup for expected use of mongoc_init() and mongoc_cleanup().
  • mongoc_client_get_database_names is removed. Use mongoc_client_get_database_names_with_opts instead.
  • mongoc_client_find_databases is removed. Use mongoc_client_find_databases_with_opts instead.
  • mongoc_client_get_max_message_size is removed.
  • mongoc_client_get_max_bson_size is removed.
  • Deprecated mongoc_apm_command_*_get_server_connection_id functions are removed. Use mongoc_apm_command_*_get_server_connection_id_int64 instead.
  • Deprecated index management API is removed:
    • mongoc_collection_create_index_with_opts, mongoc_collection_create_index, and mongoc_collection_ensure_index are removed. Use mongoc_collection_create_indexes_with_opts instead.
    • mongoc_index_opt_t, mongoc_index_opt_geo_t mongoc_index_opt_wt_t are removed. Pass options using bson_t to mongoc_collection_create_indexes_with_opts instead.
    • mongoc_collection_find_indexes is removed. Use mongoc_collection_find_indexes_with_opts instead.
    • See MongoDB documentation for working with indexes.
  • Deprecated cursor API is removed:
    • mongoc_cursor_is_alive is removed. Use the equivalent mongoc_cursor_more instead.
    • mongoc_cursor_set_hint is removed. Use the equivalent mongoc_cursor_set_server_id instead.
    • mongoc_cursor_get_hint is removed. Use the equivalent mongoc_cursor_get_server_id instead.
    • mongoc_cursor_new_from_command_reply is removed. Use mongoc_cursor_new_from_command_reply_with_opts instead.
  • Deprecated CRUD API is removed:
    • mongoc_collection_save is removed. Use mongoc_collection_insert_one or mongoc_collection_replace_one instead.
    • mongoc_collection_delete is removed. Use mongoc_collection_delete_one or mongoc_collection_delete_many instead.
    • mongoc_delete_flags_t and mongoc_reply_flags_t are removed.
    • mongoc_collection_find is removed. Use mongoc_collection_find_with_opts instead.
    • mongoc_collection_insert_bulk is removed. Use mongoc_collection_insert_many instead.
    • mongoc_collection_create_bulk_operation is removed. Use `mongoc_collection_create_bulk_operation_wi...
Read more

mongo-c-driver 1.30.2

04 Mar 16:27
1.30.2
d318059
Compare
Choose a tag to compare

Announcing 1.30.2 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Fixes:

  • Fix bson_new_from_buffer behavior on malformed input.
  • Fix allocation of large bson_t.

libmongoc

Fixes:

  • Fix C23 build on Windows.

Links:

Thanks to everyone who contributed to this release.

  • Jeroen Ooms
  • Micah Scott
  • Kevin Albertson

mongo-c-driver 1.30.1

21 Feb 14:36
1.30.1
81db5f2
Compare
Choose a tag to compare

Announcing 1.30.1 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Fixes:

  • Fix BSON_NORETURN macro for C23 standard

libmongoc

No changes since 1.30.0. Version incremented to match the libbson version.

Links:

Thanks to everyone who contributed to this release.

  • Micah Scott

mongo-c-driver 1.30.0

05 Feb 17:52
1.30.0
be3955b
Compare
Choose a tag to compare

Announcing 1.30.0 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Improvements:

  • Improve performance of BSON-to-JSON serialization for nested documents.

Fixes:

  • Truncated output of bson_as_json_with_opts is changed to no longer split valid UTF-8 sequences.
  • Changes were made to the generated JSON text in some cases:
    • Previously, empty arrays and documents would serialize with either one or two spaces depending on whether it is nested. Empty arrays and documents now consistently serialize with just one space.
    • Previously, an array omitted due to the maximum recursion limit would serialize to "{ ... }", as if it were a document. Omitted arrays now serialize to "[ ... ]".
    • The maximum recursion limit now applies to legacy codewscope documents. Deeply nested scope documents will now be omitted like any other deeply nested document.
  • Fix leak of output parameter on failed call to bson_append_array_builder_begin.

Deprecated:

  • Support for Debian 9 and Debian 10.

libmongoc

New Features:

  • Add support for structured logging.
    • See mongoc_client_set_structured_log_opts and mongoc_client_pool_set_structured_log_opts.
  • Add option to configure cache lifetime of In-Use Encryption data encryption keys.
    • See mongoc_auto_encryption_opts_set_key_expiration and mongoc_client_encryption_opts_set_key_expiration.
  • Support sort option for update and replace operations.
  • Support constructing a mongoc_bulkwrite_t without a client.
    • See mongoc_bulkwrite_new and mongoc_bulkwrite_set_client.

Improvements:

  • Improve performance of mongoc_server_description_new_copy.

Fixes:

  • Additional APM events required by the SDAM specification will now be delivered:
    • Servers that have seen server_opening will now see a server_closed prior to topology_closed.
    • Before topology_closed, a topology_changed event will transition to Unknown topology type.
  • Fix reporting insert IDs in mongoc_bulkwrite_t when verbose results requested.

Deprecated:

  • Support for Debian 9 and Debian 10.

Links:

Thanks to everyone who contributed to this release.

  • Kevin Albertson
  • Micah Scott
  • Jeremy Mikola
  • Adrian Dole
  • Ezra Chung
  • Antony Polukhin
  • Jeroen Ooms
  • Colby Pike

mongo-c-driver 1.29.2

07 Jan 13:32
1.29.2
48011c6
Compare
Choose a tag to compare

Announcing 1.29.2 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

No changes since 1.29.1. Version incremented to match the libmongoc version.

libmongoc

Fixes:

  • Rename set_error function to avoid symbol conflicts.
  • Fix Windows ARM 64 build.
  • Fix comparison of uninitialized bytes.
  • Fix format specifier on macOS.

Notes:

  • Windows ARM 64 is not-yet officially tested or supported. Support is community driven.

Links:

Thanks to everyone who contributed to this release.

  • Adrian Dole
  • Christian Schmitz
  • Antony Polukhin
  • Kevin Albertson

mongo-c-driver 1.29.1

11 Dec 18:29
1.29.1
8663e6d
Compare
Choose a tag to compare

Announcing 1.29.1 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Fixes:

  • Fix result of bson_strerror_r on macOS.
  • Fix max length string handling bson_value_copy.

libmongoc

Fixes:

  • Assert session is consistent with client in mongoc_bulkwrite_set_session.

Links:

Thanks to everyone who contributed to this release.

  • Jeremy Mikola
  • Kevin Albertson

mongo-c-driver 1.29.0

06 Nov 19:45
1.29.0
fc82e03
Compare
Choose a tag to compare

Announcing 1.29.0 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Deprecated:

  • bson_string_t and associated functions are deprecated and planned for removal in a future major release.
  • Compiling with BSON_MEMCHECK defined is deprecated.
  • bson_in_range_* and bson_cmp_* functions.
  • bson_atomic_* and bson_thrd_yield functions.
  • bson_as_json and bson_array_as_json are deprecated due to producing non-portable Legacy Extended JSON. Prefer Canonical Extended JSON or Relaxed Extended JSON for portability. To continue using Legacy Extended JSON, use bson_as_legacy_extended_json and bson_array_as_legacy_extended_json.

Fixes:

  • Fix Relaxed Extended JSON encoding of dates after year 9999.

Improvements:

  • Improve performance of bson_utf8_escape_for_json

libmongoc

Improvements:

  • Retry KMS requests on transient errors.

Platform Support:

  • Support for Visual Studio 2013 is dropped.

Deprecated:

  • mongoc_client_command is deprecated and planned for removal in a future release. Use mongoc_client_command_simple instead.
  • mongoc_database_command is deprecated and planned for removal in a future release. Use mongoc_database_command_simple instead.
  • mongoc_collection_command is deprecated and planned for removal in a future release. Use mongoc_collection_command_simple instead.

Notes:

  • Raise required version of libmongocrypt to 1.12.0 to support In-Use Encryption (corresponds to the CMake option: ENABLE_CLIENT_SIDE_ENCRYPTION).
  • A future minor release will raise the minimum supported MongoDB Server version from 4.0 to 4.2. This is in accordance with MongoDB Software Lifecycle Schedules. Support for MongoDB Server 4.0 will be dropped in a future release!

Links:

Thanks to everyone who contributed to this release.

  • Kevin Albertson
  • Ezra Chung
  • Micah Scott
  • Adrian Dole
  • Andreas Braun
  • Joshua Siegel

mongo-c-driver 1.28.1

09 Oct 15:48
1.28.1
97f166d
Compare
Choose a tag to compare

Announcing 1.28.1 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

Fixes:

  • Fix large string handling in bson_string_truncate.
  • Fix possible crash in bson_value_copy.

libmongoc

Fixes:

  • Do not return result in mongoc_bulkwritereturn_t if there are no known successful writes.
  • Validate lengths in ill-formed server responses.
  • Do not override read preference when using aggregate with $out/$merge with unscanned servers.
  • Remove unexpected warning if authSource in TXT record is overriden by URI option.
  • Fix crash when non-existent CA file configured with OpenSSL.

Links:

Thanks to everyone who contributed to this release.

  • Ezra Chung
  • Joshua Siegel
  • Kevin Albertson

mongo-c-driver 1.28.0

18 Sep 15:27
1.28.0
a463a46
Compare
Choose a tag to compare

Announcing 1.28.0 of libbson and libmongoc, the libraries constituting the MongoDB C Driver.

libbson

New features:

  • Add bson_validate_with_error_and_offset.

Build Configuration:

  • Remove automatic ccache detection and usage (CCache.cmake).
  • Remove MONGO_USE_CCACHE (no longer applicable; see above).

libmongoc

New features:

  • Support In-Use Encryption range queries.
  • Include insert ID on result of mongoc_collection_insert_one.
  • Add new bulk write API mongoc_bulkwrite_t. Requires MongoDB 8.0. Reduces round-trips for mixed writes.
  • Add serverMonitoringMode URI option.

Improvements:

  • Improve performance of OpenSSL connection creation.
  • Improve performance when trace logging is configured (ENABLE_TRACING=ON) but disabled at runtime.
  • Prefer FIPS compliant functions for SCRAM-SHA-256 key derivation.
  • Remove required slash to delimit options in MongoDB URI (e.g. mongodb://example.com?w=1 parses the same as mongodb://example.com/?w=1).
  • Include topology description in server selection timeout errors.

Notes:

  • Bump minimum wire protocol version from 6 (MongoDB 3.6) to 7 (MongoDB 4.0).
  • Raise required version of libmongocrypt to 1.11.0 to support In-Use Encryption (corresponds to the CMake option: ENABLE_CLIENT_SIDE_ENCRYPTION).

Build Configuration:

  • Remove automatic ccache detection and usage (CCache.cmake).
  • Remove MONGO_USE_CCACHE (no longer applicable; see above).

Changed:

  • Test and example targets are excluded from the ALL target.
    • All test targets can be built using the mongo_c_driver_tests target.
    • All example targets can be built using the mongo_c_driver_examples target.
  • Use #!/usr/bin/env bash instead of #!/bin/sh in uninstall script generated by ENABLE_UNINSTALL=ON.

Deprecated:

  • Use of *_hint functions is deprecated in favor of more aptly named *_server_id functions:

    • mongoc_bulk_operation_set_hint is deprecated for mongoc_bulk_operation_set_server_id
    • mongoc_bulk_operation_get_hint is deprecated for mongoc_bulk_operation_get_server_id
    • mongoc_cursor_set_hint is deprecated for mongoc_cursor_set_server_id
    • mongoc_cursor_get_hint is deprecated for mongoc_cursor_get_server_id
  • A future minor release plans to drop support for Visual Studio 2013.

  • ENABLE_SSL=LIBRESSL is deprecated along with mongoc_stream_tls_libressl_new. Support for LibreSSL may be dropped in a future major release.

  • ENABLE_SASL=CYRUS on Windows platforms is deprecated. Support for ENABLE_SASL=CYRUS on Windows may be dropped in a future major release.

    • The associated Windows-only option CYRUS_PLUGIN_PATH_PREFIX is deprecated.

Links: