Upgrading

This version is not binary compatible with the 1.2.4 version of the driver.

To fully support the aggregation command cursors the return type for all methods of a collection that had returned a List now return a MongoIterator. To make porting applications easier the MongoIterator now has a toList() method that will consume any remaining results for the iterator and return it as a List.

Updates and Improvements:

Enhancements

  • Fully support for all MongoDB 2.6 features including:
  • Performance:
    • We have further reduced BSON encoding and decoding times. Part of the improvement is due to using an intelligent cache for encoding and decoding strings.
    • The driver now, by default, uses a single read thread per connection instead of 2 threads (read/write) per connection. This further reduced the latency of operations.
    • We have rerun the YCSB, BSON and basic benchmarks and published the updated results.
  • Introduction of the mongodb-async-examples project on GitHub which contains a number demonstration applications for the driver's features.
  • Extension Enhancements
    • Custom TLS/SSL connection factory with server host name verification and configurable trust models.
    • Plain SASL authentication support for use with LDAP or PAM.
    • X.509 authentication support.
    • Support for a custom service name with Kerberos and Plan SASL authentication.
    • Initial support for removing the mongos bottleneck in a sharded cluster. See this series of blog posts for details.
  • Other Notable Changes
    • Lambdas! The driver now provides a single method callback that can be used with Java 8 lambdas. See the LambdaCallback interface.
    • The Future returned from asynchronous methods is now a ListenableFuture. The ListenableFuture interface support addListener(Runnable,Executor) inspired by the Google Guava Library.
    • The driver will now detect some incompatible operations (both too new and too old) before sending them to the server and throw a ServerVersionException describing the problem. We hope to improve this feature over time.
    • Thanks to the Flip/Flop replica set provided by MongoLab the drivers fail-over handling has been greatly enhanced. The driver will now block operations once the primary is down and release the operations once the primary is successfully determined. Users can configure the maximum amount of time an operation will block via the configuration. See the Flip/Flop Demos.
    • The driver will detect the existence of SLF4J logging framework and use it instead of (JUL) (Java Util Logging). See the Micro-logging framework Package The framework uses reflection and the driver does not have a dependency on SLF4J.
    • Support for RFC-2732 IPv6 addresses.
  • License Change
    • The core driver is now released under the Apache License, Version 2.0. The extensions jar is only available under the commercial license agreement. See the project license for details.

Deprecations

  • Text, Text.Builder, TextResult have been deprecated since the MongoDB text command is now deprecated. Use the $text query operator instead.
  • GeospatialOperator.UNIQUE_DOCS_MODIFIER is now deprecated as MongoDB 2.6 no longer supports the option. This change also deprecated a number of methods within the ConditionBuilder which provided support for setting UNIQUE_DOCS_MODIFIER.