1.2.0-beta.1
Pre-releaseWe are pleased to announce our first beta release for the upcoming 1.2.0 release of the Swift driver. We would love for you to try it out!
This release most notably adds support for the following features:
MongoDB Versioned API
MongoDB 5.0 introduced supported for the versioned API, which will make it much easier for users to upgrade their server versions without experiencing backward-breaking changes.
To specify an API version for your application, provide a version via MongoClientOptions
(currently, the only supported API version is 1):
let opts = MongoClientOptions(
serverAPI: MongoServerAPI(version: .v1)
)
// Create an async client
let client = try MongoClient("mongodb://localhost:27017", using: myEventLoopGroup, options: opts)
// Or, create a sync client
let client = try MongoClient("mongodb://localhost:27017", options: opts)
Serverless MongoDB Support / Load Balancer Support
This release adds support for using the driver with Serverless MongoDB, which is currently in preview.
This is enabled via new support for connecting to a MongoDB cluster behind a TCP load balancer, which is supported via the loadBalanced
connection string option or by setting the loadBalanced
property on MongoClientOptions
.
OCSP Support
The driver previously had implicit support for the Online Certificate Status Protocol (OCSP) via the underlying C driver, however as part of this release we have added explicit testing for this from Swift along with support for configuring it programmatically via MongoClientOptions
, using the tlsDisableCertificateRevocationCheck
and tlsDisableOCSPEndpointCheck
options.
Please see our TLS Guide for more information.
Below are a selected list of tickets with user-facing implications; for a full list of completed tickets see this Jira query.
Included Tickets
Bug
- SWIFT-1322 - listCollections does not respect batchSize option
- SWIFT-1347 - ClientSession.pinnedServerAddress leaks memory (in tests only)
New Feature
- SWIFT-787 - OCSP Support
- SWIFT-1025 - Versioned MongoDB API for Drivers
- SWIFT-1094 - Load Balancer Support
- SWIFT-797 - Allow hinting the delete command
- SWIFT-801 - support ability to pass hint to update
- SWIFT-904 - Add connectTimeoutMS option to MongoClientOptions
- SWIFT-1157 - Implement ExpressibleByXLiteral for IndexHint
- SWIFT-788 - Allow passing hint to findAndModify update and replace operations
Improvement
- SWIFT-910 - Lift restriction on authSource without credentials
- SWIFT-1099 - Change estimatedDocumentCount() to use the $collStats Agg Stage Instead of Count Command
- SWIFT-1100 - Implement change stream oplog parsing code for delta oplog entries
- SWIFT-1107 - Mitigate pain of using field names with dots and dollars
- SWIFT-1224 - Bump maxWireVersion for MongoDB 5.0
- SWIFT-1307 - Expose serviceId in command monitoring events
Task
- SWIFT-1256 - Vendor libmongoc 1.19.0