Upgrading
This version is source compatible with the 1.0.2 version of the driver.
It is recommended that users recompile against the new driver as many methods have moved to different interfaces and classes to support the Mongo --> MongoClient migration.
Updates and Improvements:
- MongoClient
- Query / Find
- Support for findOne() with the full set of Find options.
- Tailable cursor support as part of the Find options.
- MongoCollection.streamingFind(...): Added support for a streaming or push query results from the datastore. Instead of the client iterating over the set of returned documents the driver will invoke a callback with each document as it is received.
- Added no-argument count() methods to the MongoCollection.count() interface for easier determination of the total number of documents in a collection.
- BSON and DocumentBuilder / ArrayBuilder
- Add a DocumentReference class to represent a DBRef.
- Updated the BSON DocumentBuilder with a add(String name, Object value) method that will create the "best fit" element for the value. A similar method was added to the ArrayBuilder.
- Updated the BSON DocumentBuilder so that the add(String name, ??? value) methods will create a NullElement if the value is null. The addXXX(...) methods can be used if a null value should trigger an error. A similar logic was added to the ArrayBuilder's add(??? value) methods.
- Updated the BSON DocumentBuilder and ArrayBuilder to more defensively validate the values used to construct documents.
- Update the BSON DocumentBuilder and ArrayBuilder to support UUID elements in both the standard and Java legacy byte encoding.
- Initial JSON to Document support and Document to JSON support. Note that not all element types will be successfully serialized and parsed to the same form during a Document-->JSON-->Document transformation. The JSON parser is genered from a JavaCC grammer so there are no additional runtime library dependancies.
- Maximum document size enforcement.
- Miscellaneous
- Support for a application provided Executor to be used for handling each response from the server off-loading the work from the Socket's receive thread.
- Support for custom SocketFactory implementations including an SSLSocketFactory.
- Support for connecting to the MongoDB server via UNIX Domain Sockets
- Better performance for selecting an active connection when the pool is large.
- Better reconnect logic, support and testing.
Deprecations
The following classes have been deprecated:
The following methods have been deprecated.