Skip to content

Releases: mongodb/mongo-c-driver

mongo-c-driver 1.5.0-rc6

17 Nov 08:17
1.5.0-rc6
de43a70
Compare
Choose a tag to compare
Pre-release

It is my pleasure to announce the beta release of mongo-c-driver 1.5.0-rc6.

New features and bug fixes:

  • MongoDB 3.4 Support
    • New URI and read preference option, "maxStalenessSeconds"
    • MongoDB Handshake
    • writeConcern and readConcern enhancements
    • Collation allows users to specify language-specific rules for string
      comparison when sorting documents. See the code examples for
      mongoc_client_read_command_with_opts, mongoc_collection_count_with_opts,
      mongoc_collection_find_with_opts, and mongoc_index_opt_t, as well as the
      "Setting Collation Order" section of the "Bulk Write Operations" guide.
  • mongoc_collection_count_with_opts uses the collection's read preference if
    none is passed in
  • Improved TLS support
    • Fixed LibreSSL (libssl) support
    • Added LibreSSL (libtls) support
    • Fixed Secure Channel build on VS 2010
    • OpenSSL now supports SNI (all others already do)
  • Additional features for Application Performance Monitoring:
    • mongoc_topology_description_has_writable_server
    • mongoc_topology_description_has_readable_server
  • New functions accept flexible options as a BSON document:
    • mongoc_collection_find_with_opts
    • mongoc_client_read_command_with_opts
    • mongoc_client_write_command_with_opts
    • mongoc_client_read_write_command_with_opts
    • mongoc_database_read_command_with_opts
    • mongoc_database_write_command_with_opts
    • mongoc_database_read_write_command_with_opts
    • mongoc_collection_read_command_with_opts
    • mongoc_collection_write_command_with_opts
    • mongoc_collection_read_write_command_with_opts
    • mongoc_gridfs_find_with_opts
    • mongoc_gridfs_find_one_with_opts
  • mongoc_collection_find is now deprecated in favor of
    mongoc_collection_find_with_opts.
  • New helper function to include read concern in one of the above function's
    options parameter: mongoc_read_concern_append.
  • mongoc_client_command no longer applies the client's read preference and
    read concern by default. Same change for mongoc_database_command and
    mongoc_collection_command.
  • mongoc_collection_count_with_opts now applies the collection's read
    preference if no read preference is provided
  • mongoc_collection_create_index and mongoc_collection_drop_index now apply
    the collection's write concern.
  • mongoc_collection_create_index_with_opts now applies the collection's
    write concern if none is specified in "opts"
  • connectTimeoutMS timer now begins after DNS resolution, and resets
    for each interface attempted (e.g., if the driver first tries IPv6,
    then IPv4).
  • New error code MONGOC_ERROR_DUPLICATE_KEY.
  • mongoc_collection_find no longer treats the "filter" key specially in
    queries - querying for a document with a key named "filter" is the same
    now as any other key.
  • The server description parameter to the following functions is "const":
    • mongoc_server_description_host
    • mongoc_server_description_id
    • mongoc_server_description_ismaster
    • mongoc_server_description_round_trip_time
    • mongoc_server_description_type
  • Exported symbols are no longer declared in seperate export files.
    This could break ABI with applications using clang, which previously
    exported symbols from the internal private ABI.
  • mongoc no longer crashes when multi roundtrip bulk operation fails.
  • Added support for the new readConcernLevel "linearizable".
  • Clients now check for misformatted "readPreferenceTags" in URI.
  • New CMake option ENABLE_TRACING allows debug output, which before had only
    been available with "configure --enable-tracing".
  • Bugfix: "PossiblePrimary"-type replicas could be selected for reads
  • Bugfixes: The random number generator used to select servers is now properly
    seeded, and secondary queries are now properly distributed according to
    localThresholdMS, not just to the lowest-latency secondary.
  • mongoc_collection_insert, mongoc_collection_update, mongoc_collection_remove
    consistently use domain MONGOC_ERROR_BSON, code MONGOC_ERROR_BSON_INVALID
    if passed oversized BSON, and MONGOC_ERROR_COLLECTION for other errors.
    mongoc_bulk_operation_execute continues to use MONGOC_ERROR_COMMAND for
    all errors.
  • If mongoc_client_pool_t fails to start its scanner thread in the background,
    it logs and aborts instead of silently continuing, then failing to connect.
  • The driver now updates its view of the whole topology with information from
    each new connection handshake.
  • mongoc_client_set_apm_callbacks can be used repeatedly to change or clear
    the list of monitoring callbacks.
  • Improved error reporting when the driver fails to reach the server.

Deprecations:

  • mongoc_collection_find is deprecated for mongoc_collection_find_with_opts.

Removed configure flags:

  • --enable-experimental has been removed. All previously experimental
    features are now always on.
  • The configure option "--enable-hardening" had had no effect. It is removed
    in favor of system-wide compiler configuration.

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Fiona Rowan
  • Ian Boros
  • Remi Collet
  • Brian McCarthy
  • Jeroen Ooms
  • J. Rassi
  • Christoph Schwarz
  • Alexey Vorobeyev

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.5.0-rc4

03 Nov 15:27
1.5.0-rc4
dcaaeeb
Compare
Choose a tag to compare
Pre-release

It is my pleasure to announce the beta release of mongo-c-driver 1.5.0.

New features and bug fixes:

  • MongoDB 3.4 Support
    • New URI and read preference option, "maxStalenessSeconds"
    • MongoDB Handshake
    • writeConcern and readConcern enhancements
    • Collation allows users to specify language-specific rules for string
      comparison when sorting documents. See the code examples for
      mongoc_client_read_command_with_opts, mongoc_collection_count_with_opts,
      mongoc_collection_find_with_opts, and mongoc_index_opt_t, as well as the
      "Setting Collation Order" section of the "Bulk Write Operations" guide.
  • mongoc_collection_count_with_opts uses the collection's read preference if
    none is passed in
  • Improved TLS support
    • Fixed LibreSSL (libssl) support
    • Added LibreSSL (libtls) support
    • Fixed Secure Channel build on VS 2010
    • OpenSSL now supports SNI (all others already do)
  • Additional features for Application Performance Monitoring:
    • mongoc_topology_description_has_writable_server
    • mongoc_topology_description_has_readable_server
  • New functions accept flexible options as a BSON document:
    • mongoc_collection_find_with_opts
    • mongoc_client_read_command_with_opts
    • mongoc_client_write_command_with_opts
    • mongoc_client_read_write_command_with_opts
    • mongoc_database_read_command_with_opts
    • mongoc_database_write_command_with_opts
    • mongoc_database_read_write_command_with_opts
    • mongoc_collection_read_command_with_opts
    • mongoc_collection_write_command_with_opts
    • mongoc_collection_read_write_command_with_opts
    • mongoc_gridfs_find_with_opts
    • mongoc_gridfs_find_one_with_opts
  • New helper function to include read concern in one of the above function's
    options parameter: mongoc_read_concern_append.
  • mongoc_client_command no longer applies the client's read preference and
    read concern by default. Same change for mongoc_database_command and
    mongoc_collection_command.
  • mongoc_collection_count_with_opts now applies the collection's read
    preference if no read preference is provided
  • mongoc_collection_create_index and mongoc_collection_drop_index now apply
    the collection's write concern.
  • mongoc_collection_create_index_with_opts now applies the collection's
    write concern if none is specified in "opts"
  • connectTimeoutMS timer now begins after DNS resolution, and resets
    for each interface attempted (e.g., if the driver first tries IPv6,
    then IPv4).
  • New error code MONGOC_ERROR_DUPLICATE_KEY.
  • mongoc_collection_find no longer treats the "filter" key specially in
    queries - querying for a document with a key named "filter" is the same
    now as any other key.
  • The server description parameter to the following functions is "const":
    • mongoc_server_description_host
    • mongoc_server_description_id
    • mongoc_server_description_ismaster
    • mongoc_server_description_round_trip_time
    • mongoc_server_description_type
  • Exported symbols are no longer declared in seperate export files.
    This could break ABI with applications using clang, which previously
    exported symbols from the internal private ABI.
  • mongoc no longer crashes when multi roundtrip bulk operation fails.
  • Added support for the new readConcernLevel "linearizable".
  • Clients now check for misformatted "readPreferenceTags" in URI.
  • New CMake option ENABLE_TRACING allows debug output, which before had only
    been available with "configure --enable-tracing".
  • Bugfix: "PossiblePrimary"-type replicas could be selected for reads
  • Bugfixes: The random number generator used to select servers is now properly
    seeded, and secondary queries are now properly distributed according to
    localThresholdMS, not just to the lowest-latency secondary.
  • mongoc_collection_insert, mongoc_collection_update, mongoc_collection_remove
    consistently use domain MONGOC_ERROR_BSON, code MONGOC_ERROR_BSON_INVALID
    if passed oversized BSON, and MONGOC_ERROR_COLLECTION for other errors.
    mongoc_bulk_operation_execute continues to use MONGOC_ERROR_COMMAND for
    all errors.
  • If mongoc_client_pool_t fails to start its scanner thread in the background,
    it logs and aborts instead of silently continuing, then failing to connect.
  • The driver now updates its view of the whole topology with information from
    each new connection handshake.
  • mongoc_client_set_apm_callbacks can be used repeatedly to change or clear
    the list of monitoring callbacks.
  • Improved error reporting when the driver fails to reach the server.

Deprecations:

  • mongoc_collection_find is deprecated for mongoc_collection_find_with_opts.

Removed configure flags:

  • --enable-experimental has been removed. All previously experimental
    features are now always on.
  • The configure option "--enable-hardening" had had no effect. It is removed
    in favor of system-wide compiler configuration.

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Fiona Rowan
  • Ian Boros
  • Remi Collet
  • Brian McCarthy
  • Jeroen Ooms
  • J. Rassi
  • Christoph Schwarz
  • Alexey Vorobeyev

Peace,

A. Jesse Jiryu Davis

mongo-c-driver 1.5.0-rc3

20 Oct 03:03
1.5.0-rc3
c5d211e
Compare
Choose a tag to compare
Pre-release

It is my pleasure to announce the beta release of mongo-c-driver 1.5.0-rc3.

New features and bug fixes:

  • MongoDB 3.4 Support
    -- * MaxStalenessMS
    -- * MongoDB Handshake
  • mongoc_collection_count_with_opts uses the collection's read preference if
    -- none is passed in
  • Improved TLS support
    -- * Fixed LibreSSL (libssl) support
    -- * Added LibreSSL (libtls) support
    -- * Fixed Secure Channel build on VS 2010
    -- * OpenSSL now supports SNI (all others already do)
  • Additional features for Application Performance Monitoring:
    -- * mongoc_topology_description_has_writable_server
    -- * mongoc_topology_description_has_readable_server
  • New command functions accept flexible options as a BSON document:
    -- * mongoc_client_read_command_with_opts
    -- * mongoc_client_write_command_with_opts
    -- * mongoc_client_read_write_command_with_opts
    -- * mongoc_database_read_command_with_opts
    -- * mongoc_database_write_command_with_opts
    -- * mongoc_database_read_write_command_with_opts
    -- * mongoc_collection_read_command_with_opts
    -- * mongoc_collection_write_command_with_opts
    -- * mongoc_collection_read_write_command_with_opts
  • New helper function to include read concern in one of the above function's
    -- options parameter: mongoc_read_concern_append.
  • mongoc_client_command no longer applies the client's read preference and
    -- read concern by default. Same change for mongoc_database_command and
    -- mongoc_collection_command.
  • mongoc_collection_count_with_opts now applies the collection's read
    -- preference if no read preference is provided
  • mongoc_collection_create_index and mongoc_collection_drop_index now apply
    -- the collection's write concern.
  • mongoc_collection_create_index_with_opts now applies the collection's
    -- write concern if none is specified in "opts"
  • connectTimeoutMS timer now begins after DNS resolution, and resets
    -- for each interface attempted (e.g., if the driver first tries IPv6,
    -- then IPv4).
  • New error code MONGOC_ERROR_DUPLICATE_KEY.
  • mongoc_collection_find no longer treats the "filter" key specially in
    -- queries - querying for a document with a key named "filter" is the same
    -- now as any other key.
  • The server description parameter to the following functions is "const":
    -- * mongoc_server_description_host
    -- * mongoc_server_description_id
    -- * mongoc_server_description_ismaster
    -- * mongoc_server_description_round_trip_time
    -- * mongoc_server_description_type
  • Exported symbols are no longer declared in seperate export files.
    -- This could break ABI with applications using clang, which previously
    -- exported symbols from the internal private ABI.
  • mongoc no longer crashes when multi roundtrip bulk operation fails.
  • Added support for the new readConcernLevel "linearizable".
  • Clients now check for misformatted "readPreferenceTags" in URI.
  • New CMake option ENABLE_TRACING allows debug output, which before had only
    -- been available with "configure --enable-tracing".
  • Bugfix: "PossiblePrimary"-type replicas could be selected for reads
  • The random number generator used to select servers is now properly seeded.
  • mongoc_collection_insert, mongoc_collection_update, mongoc_collection_remove
    -- consistently use domain MONGOC_ERROR_BSON, code MONGOC_ERROR_BSON_INVALID
    -- if passed oversized BSON, and MONGOC_ERROR_COLLECTION for other errors.
    -- mongoc_bulk_operation_execute continues to use MONGOC_ERROR_COMMAND for
    -- all errors.

Removed configure flags:

  • --enable-experimental has been removed. All previously experimental
    -- features are now always on.
  • The configure option "--enable-hardening" had had no effect. It is removed
    -- in favor of system-wide compiler configuration.

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Fiona Rowan
  • Ian Boros
  • Remi Collet
  • Brian McCarthy
  • Jeroen Ooms
  • J. Rassi
  • Christoph Schwarz
  • Alexey Vorobeyev

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.3.6

18 Oct 22:54
1.3.6
ff05439
Compare
Choose a tag to compare

It is my pleasure to announce mongo-c-driver 1.3.6. This is a bugfix release:

  • Connect timeout when libmongoc is used by the MongoDB PHP Driver to connect
    -- to a replica set with one or more unresponsive members.
  • "connection timeout" and "connection error" messages were swapped.
  • "make abicheck" failed.

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Remi Collet

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.5.0-rc2

12 Oct 02:33
e4764d0
Compare
Choose a tag to compare
Pre-release

It is my pleasure to announce the beta release of mongo-c-driver 1.5.0-rc2

New features and bug fixes:

  • MongoDB 3.4 Support
    • MaxStalenessMS
    • MongoDB Handshake
  • mongoc_collection_count_with_opts uses the collection's read preference if
    none is passed in
  • Improved TLS support
    • Fixed LibreSSL (libssl) support
    • Added LibreSSL (libtls) support
    • Fixed Secure Channel build on VS 2010
    • OpenSSL now supports SNI (all others already do)
  • Additional features for Application Performance Monitoring:
    • mongoc_topology_description_has_writable_server
    • mongoc_topology_description_has_readable_server
  • connectTimeoutMS timer now begins after DNS resolution, and resets
    for each interface attempted (e.g., if the driver first tries IPv6,
    then IPv4).
  • New error code MONGOC_ERROR_DUPLICATE_KEY.
  • mongoc_collection_find no longer treats the "filter" key specially in
    queries - querying for a document with a key named "filter" is the same
    now as any other key.
  • The server description parameter to the following functions is "const":
    • mongoc_server_description_host
    • mongoc_server_description_id
    • mongoc_server_description_ismaster
    • mongoc_server_description_round_trip_time
    • mongoc_server_description_type
  • Exported symbols are no longer declared in seperate export files.
    This could break ABI with applications using clang, which previously
    exported symbols from the internal private ABI.
  • mongoc no longer crashes when multi roundtrip bulk operation fails.
  • Added support for the new readConcernLevel "linearizable".

Removed configure flags:

  • --enable-experimental has been removed and all of its features
    are always available now
  • --enable-hardening has been removed. The flag never actually enabled
    any hardening features and has therefore been removed

Thanks to everyone who contributed to the development of this release.

  • Everyone

Farewell,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.4.2

30 Sep 20:23
1.4.2
01cb797
Compare
Choose a tag to compare

It is my pleasure to announce mongo-c-driver 1.4.2. This release fixes bugs in
"minPoolSize" logic, see CDRIVER-1558 for details.

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.4.1

20 Sep 18:47
Compare
Choose a tag to compare

It is my pleasure to announce mongo-c-driver 1.4.1. This is a bugfix release:

  • mongoc_client_get_server_descriptions could return a list including NULLs
  • Tailable cursors on MongoDB 3.2 only worked with MONGOC_QUERY_AWAIT_DATA
  • Spurious warnings with MONGOC_DISABLE_SHM

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.4.0

10 Aug 21:02
Compare
Choose a tag to compare

It is my pleasure to announce mongo-c-driver 1.4.0.

TLS

The driver can now use the native TLS and crypto functions included in Mac OS X
and Windows. OpenSSL is no longer required for TLS or authentication on Mac or
Windows. By default, OpenSSL is used if available, the default will switch in
version 2.0 to prefer native TLS.

For native TLS on Mac:

./configure --enable-ssl=darwin

For Windows:

cmake "-DENABLE_SSL=WINDOWS" -G "Visual Studio 10 Win64" "-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver"

All of the TLS implementations now load the native default certificate store,
with OpenSSL on Windows falling back on the Windows native certificate store if
no other can be found.

The "ca_dir" field on mongoc_ssl_opt_t is only supported by OpenSSL. All other
fields, including "pem_file", are supported by all implementations.

A new field, "allow_invalid_hostname", has been added to mongoc_ssl_opt_t and is
preferred over the existing "allow_invalid_certificate" to disable hostname
verification.

See the documentation for mongoc_ssl_opt_t for details.

The driver now supports the latest OpenSSL 1.1 in addition to past versions.

Application Performance Monitoring

The driver implements the MongoDB Command Monitoring Spec. Applications can
record the duration and other details of every operation the driver performs on
the server. See "Introduction to Application Performance Monitoring" in the
docs.

Error API

New functions mongoc_client_set_error_api and mongoc_client_pool_set_error_api
allow applications to distinguish client and server errors. See the "Error
Reporting" doc.

Unacknowledged Write Results

Unacknowledged writes (writes whose mongoc_write_concern_t "w" value is zero)
now reply with an empty document instead of one with nInserted: 0, nUpdated: 0,
and so on.

Command functions now ignore the read preferences set on a client, database,
or collection. Instead, they use the mongoc_read_prefs_t passed in explicitly,
or default to "primary". This change was made to bring them in line with the
Server Selection Spec. These are the affected functions:

  • mongoc_client_command
  • mongoc_client_command_simple
  • mongoc_database_command
  • mongoc_database_command_simple
  • mongoc_collection_command
  • mongoc_collection_command_simple

On the other hand, the following command-specific helper functions now use the
collection's read preference:

  • mongoc_collection_count
  • mongoc_collection_stats

New functions to send maxTimeMS or any arbitrary options with findAndModify:

  • mongoc_find_and_modify_opts_set_max_time_ms
  • mongoc_find_and_modify_opts_append

New function to include a write concern with a generic command function
like mongoc_client_command_simple:

  • mongoc_write_concern_append

Public API For Higher-Level Drivers

New functions support language drivers (specifically the PHP and HHVM drivers)
using only the libmongoc public API:

  • mongoc_bulk_operation_get_hint
  • mongoc_client_command_simple_with_server_id
  • mongoc_client_get_server_description
  • mongoc_client_get_server_description_by_id
  • mongoc_client_get_server_descriptions
  • mongoc_client_select_server
  • mongoc_cursor_get_limit
  • mongoc_cursor_new_from_command_reply
  • mongoc_cursor_set_hint
  • mongoc_cursor_set_limit
  • mongoc_log_trace_disable
  • mongoc_log_trace_enable
  • mongoc_server_description_ismaster
  • mongoc_server_description_round_trip_time
  • mongoc_server_description_type
  • mongoc_server_descriptions_destroy_all
  • mongoc_uri_get_option_as_bool
  • mongoc_uri_get_option_as_int32
  • mongoc_uri_get_option_as_utf8
  • mongoc_uri_option_is_bool
  • mongoc_uri_option_is_int32
  • mongoc_uri_option_is_utf8
  • mongoc_uri_set_auth_source
  • mongoc_uri_set_database
  • mongoc_uri_set_option_as_bool
  • mongoc_uri_set_option_as_int32
  • mongoc_uri_set_option_as_utf8
  • mongoc_uri_set_password
  • mongoc_uri_set_read_concern
  • mongoc_uri_set_read_prefs_t
  • mongoc_uri_set_username
  • mongoc_uri_set_write_concern
  • mongoc_write_concern_is_acknowledged
  • mongoc_write_concern_is_valid
  • mongoc_write_concern_journal_is_set

Now that these public APIs are available, the PHP drivers no longer define the
MONGOC_I_AM_A_DRIVER preprocessor symbol to access private APIs. The symbol is
removed from C Driver headers, and libmongoc-priv.so is no longer installed.

Other Features

  • New connection string option "localThresholdMS".
  • zSeries, POWER8, and ARM 64-bit platform support.
  • Performance enhancements, reduce allocation and copying in command code.
  • All man page names now begin with "mongoc_" to avoid install conflicts.
  • New function mongoc_gridfs_file_set_id.

Deprecations

Automatically calling mongoc_init and mongoc_cleanup is a GCC-specific feature
that is now deprecated, and will be removed in version 2. The driver should be
built with:

./configure --disable-automatic-init-and-cleanup

Or:

cmake "-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF" -G "Visual Studio 10 Win64" "-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver"

In this configuration, applications must explicitly init and cleanup libmongoc.

Deprecated functions:

  • mongoc_write_concern_get_fsync
  • mongoc_write_concern_set_fsync

Notable Bug Fixes

  • Logic bugs using tag sets to select replica set members with complex configs
  • mongoc_client_get_database_names no longer filters out a replica set
    -- member's "local" database.
  • mongoc_client_get_gridfs now ensures the proper indexes on the files and
    -- chunks collections.
  • SecondaryPreferred fails if primary matches tags but secondaries don't.
  • mongoc_collection_find_and_modify_with_opts can return true on
    -- writeConcernError.
  • mongoc_collection_validate doesn't always init "reply".
  • The strings referred to by mongoc_ssl_opt_t, like pem_file and ca_file, are
    -- now copied into the client or client pool by mongoc_client_set_ssl_opts or
    -- mongoc_client_pool_set_ssl_opts, and need not be kept valid afterward.
  • mongoc_collection_count_with_opts ignored flags and read_prefs.
  • minPoolSize of 0 should mean "no minimum".
  • mongoc_database_create_collection should always use the primary.
  • The GSSAPI properties SERVICE_NAME and CANONICALIZE_HOST_NAME are now
    -- properly parsed from the URI, see the "Authentication" doc for details.
  • Comprehensive compatibility with various C standards and compilers.
  • mongoc_bulk_operation_execute didn't initialize "reply" if it was passed
    -- invalid arguments.

Acknowledgments

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Ian Boros
  • Fiona Rowan
  • Jeremy Mikola
  • Christoph Schwarz
  • Remi Collet
  • Derick Rethans
  • Mike Lloyd
  • David Hatch
  • Brian Samek
  • Jean-Bernard Jansen

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.4.0-beta1

28 Jul 01:43
Compare
Choose a tag to compare
Pre-release

It is my pleasure to announce the beta release of mongo-c-driver 1.4.0.

TLS

The driver can now use the native TLS and crypto functions included in Mac OS X
and Windows. OpenSSL is no longer required for TLS or authentication on Mac or
Windows. By default, OpenSSL is used if available, the default will switch in
version 2.0 to prefer native TLS.

For native TLS on Mac:

./configure --enable-ssl=darwin

For Windows:

cmake "-DENABLE_SSL=WINDOWS" -G "Visual Studio 10 Win64" "-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver"

All of the TLS implementations now load the native default certificate store,
with OpenSSL on Windows falling back on the Windows native certificate store if
no other can be found.

The "ca_dir" field on mongoc_ssl_opt_t is only supported by OpenSSL. All other
fields, including "pem_file", are supported by all implementations.

A new field, "allow_invalid_hostname", has been added to mongoc_ssl_opt_t and is
preferred over the existing "allow_invalid_certificate" to disable hostname
verification.

The driver now supports the latest OpenSSL 1.1 in addition to past versions.

Application Performance Monitoring

The driver implements the MongoDB Command Monitoring Spec. Applications can
record the duration and other details of every operation the driver performs on
the server. See "Introduction to Application Performance Monitoring" in the
docs.

Error API

New functions mongoc_client_set_error_api and mongoc_client_pool_set_error_api
allow applications to distinguish client and server errors. See the "Error
Reporting" doc.

Unacknowledged Write Results

Unacknowledged writes (writes whose mongoc_write_concern_t "w" value is zero)
now reply with an empty document instead of one with nInserted: 0, nUpdated: 0,
and so on.

Command functions now ignore the read preferences set on a client, database,
or collection. Instead, they use the mongoc_read_prefs_t passed in explicitly,
or default to "primary". This change was made to bring them in line with the
Server Selection Spec. These are the affected functions:

  • mongoc_client_command
  • mongoc_client_command_simple
  • mongoc_database_command
  • mongoc_database_command_simple
  • mongoc_collection_command
  • mongoc_collection_command_simple

On the other hand, the following command-specific helper functions now use the
collection's read preference:

  • mongoc_collection_count
  • mongoc_collection_stats

New functions to send maxTimeMS or any arbitrary options with findAndModify:

  • mongoc_find_and_modify_opts_set_max_time_ms
  • mongoc_find_and_modify_opts_append

New function to include a write concern with a generic command function
like mongoc_client_command_simple:

  • mongoc_write_concern_append

Public API For Higher-Level Drivers

New functions support language drivers (specifically the PHP and HHVM drivers)
using only the libmongoc public API:

  • mongoc_bulk_operation_get_hint
  • mongoc_client_command_simple_with_server_id
  • mongoc_client_get_server_description
  • mongoc_client_get_server_description_by_id
  • mongoc_client_get_server_descriptions
  • mongoc_client_select_server
  • mongoc_cursor_get_limit
  • mongoc_cursor_new_from_command_reply
  • mongoc_cursor_set_hint
  • mongoc_cursor_set_limit
  • mongoc_log_trace_disable
  • mongoc_log_trace_enable
  • mongoc_server_description_ismaster
  • mongoc_server_description_round_trip_time
  • mongoc_server_description_type
  • mongoc_server_descriptions_destroy_all
  • mongoc_uri_get_option_as_bool
  • mongoc_uri_get_option_as_int32
  • mongoc_uri_get_option_as_utf8
  • mongoc_uri_option_is_bool
  • mongoc_uri_option_is_int32
  • mongoc_uri_option_is_utf8
  • mongoc_uri_set_auth_source
  • mongoc_uri_set_database
  • mongoc_uri_set_option_as_bool
  • mongoc_uri_set_option_as_int32
  • mongoc_uri_set_option_as_utf8
  • mongoc_uri_set_password
  • mongoc_uri_set_read_concern
  • mongoc_uri_set_read_prefs_t
  • mongoc_uri_set_username
  • mongoc_uri_set_write_concern
  • mongoc_write_concern_is_acknowledged
  • mongoc_write_concern_is_valid
  • mongoc_write_concern_journal_is_set

Now that these public APIs are available, the PHP drivers no longer define the
MONGOC_I_AM_A_DRIVER preprocessor symbol to access private APIs. The symbol is
removed from C Driver headers, and libmongoc-priv.so is no longer installed.

Other Features

  • New connection string option "localThresholdMS".
  • zSeries and POWER8 platform support.
  • Performance enhancements, reduce allocation and copying in command code.
  • All man page names now begin with "mongoc_" to avoid install conflicts.
  • New function mongoc_gridfs_file_set_id.

Deprecations

Automatically calling mongoc_init and mongoc_cleanup is a GCC-specific feature
that is now deprecated, and will be removed in version 2. The driver should be
built with:

./configure --disable-automatic-init-and-cleanup

Or:

cmake "-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF" -G "Visual Studio 10 Win64" "-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver"

In this configuration, applications must explicitly init and cleanup libmongoc.

Deprecated functions:

  • mongoc_write_concern_get_fsync
  • mongoc_write_concern_set_fsync

Notable Bug Fixes

  • mongoc_client_get_database_names no longer filters out a replica set
    -- member's "local" database.
  • mongoc_client_get_gridfs now ensures the proper indexes on the files and
    -- chunks collections.
  • SecondaryPreferred fails if primary matches tags but secondaries don't.
  • mongoc_collection_find_and_modify_with_opts can return true on
    -- writeConcernError.
  • mongoc_collection_validate doesn't always init "reply".
  • The strings referred to by mongoc_ssl_opt_t, like pem_file and ca_file, are
    -- now copied into the client or client pool by mongoc_client_set_ssl_opts or
    -- mongoc_client_pool_set_ssl_opts, and need not be kept valid afterward.
  • mongoc_collection_count_with_opts ignored flags and read_prefs.
  • minPoolSize of 0 should mean "no minimum".
  • mongoc_database_create_collection should always use the primary.
  • The GSSAPI properties SERVICE_NAME and CANONICALIZE_HOST_NAME are now
    -- properly parsed from the URI, see the "Authentication" doc for details.
  • Comprehensive compatibility with various C standards and compilers.

Acknowledgments

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson
  • Ian Boros
  • Fiona Rowan
  • Jeremy Mikola
  • Christoph Schwarz
  • Mike Lloyd
  • Remi Collet
  • Jean-Bernard Jansen
  • David Hatch
  • Derick Rethans
  • Brian Samek

Peace,
-- A. Jesse Jiryu Davis

mongo-c-driver 1.3.5

30 Mar 20:48
Compare
Choose a tag to compare

It is my pleasure to announce mongo-c-driver 1.3.5. This release fixes a crash
in mongoc_cleanup when an allocator had been set with bson_mem_set_vtable, and
introduces a configure option MONGOC_NO_AUTOMATIC_GLOBALS which prevents code
built with GCC from automatically calling mongoc_init and mongoc_cleanup when
your code does not.

Thanks to everyone who contributed to the development of this release.

  • A. Jesse Jiryu Davis
  • Hannes Magnusson

Peace,
-- A. Jesse Jiryu Davis