Skip to content

MongoSwift 0.1.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@kmahar kmahar released this 04 Jun 18:23

We are pleased to announce the 0.1.1 release of the MongoDB Swift driver.

Release Highlights

Sessions support

This release adds support for MongoDB client sessions. This allows the driver to make certain causal consistency guarantees for operations that are executed using the same session, depending on the write/read concern configuration. See the official MongoDB documentation for more information on these guarantees, and the documentation on ClientSession for example usage.

Simpler Initialization and Cleanup

Previously, we required that users call MongoSwift.initialize() before using the driver to set up some global state and resources. We've now deprecated this method, and made it so that initialization happens automatically the first time you create a MongoClient.

Additionally, note that MongoSwift.cleanup() (which should be called exactly once when your application is done using the driver) has been deprecated and renamed cleanupMongoSwift(). Please see SWIFT-402 for context on the name change.

Mutable options structs

All of the properties stored in options structs are now vars, allowing you to do things like:

var options = FindOptions()
options.batchSize =  10
options.skip = 5

Included tickets

Bug

  • [SWIFT-404] - expireAfter index option is not correctly encoded
  • [SWIFT-405] - Document.count should not be publicly settable

New Feature

Improvement

  • [SWIFT-311] - MongoClient/MongoDatabase/MongoCollection ReadPreference getters should not return Optionals
  • [SWIFT-355] - Make options properties mutable to allow changing them after creation
  • [SWIFT-402] - Handle MongoSwift name conflicts
  • [SWIFT-413] - Make properties of WriteModel implementations public