MongoDB Swift Driver¶
Introduction¶
This is the official MongoDB Swift Driver.
Installation¶
See Installation
Connect to MongoDB Atlas¶
To connect to a MongoDB Atlas cluster, use the Atlas connection string for your cluster:
import MongoSwiftSync defer { // free driver resources cleanupMongoSwift() } let client = try MongoClient("mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority") let db = client.db("myDB") // your application logic
Compatibility¶
MongoDB Compatibility¶
Swift Driver | MongoDB 4.4 | MongoDB 4.2 | MongoDB 4.0 | MongoDB 3.6 |
---|---|---|---|---|
1.0.0 | ✓ (*) | ✓ | ✓ | ✓ |
The Swift driver is not compatible with MongoDB server versions older than 3.6.
(*) Not all features in MongoDB 4.4 are available in this version of the driver including OCSP and MONGODB-AWS. These features will be included in future versions of the driver.
Language Compatibility¶
The MongoDB Swift driver requires Swift 5.1 or later.
For more information on how to read the compatibility tables, see our guide on MongoDB Compatibility Tables.
How to get help¶
- Ask questions on our MongoDB Community Forums.
- Visit our Support Channels.
- See our SWIFT JIRA project to raise issues or request features.
Give Feedback