@@ -19,12 +19,7 @@ Introduction
1919
2020This is the official MongoDB Swift Driver.
2121
22- .. admonition:: Alpha Release
23-    :class: important
24- 
25-    The MongoDB Swift Driver is currently in alpha.
26- 
27- - `Usage Guide <https://mongodb.github.io/mongo-swift-driver/index.html#example-usage>`__
22+ - `Usage Guide <https://github.com/mongodb/mongo-swift-driver#example-usage>`__
2823
2924- `API Reference <https://mongodb.github.io/mongo-swift-driver>`__
3025
@@ -36,24 +31,59 @@ This is the official MongoDB Swift Driver.
3631Installation
3732------------
3833
39- See `Installation <https://mongodb. github.io/ mongo-swift-driver/index.html #installation>`__
34+ See `Installation <https://github.com/mongodb/ mongo-swift-driver#installation>`__
4035
4136
4237Connect to MongoDB Atlas
4338------------------------
4439
4540.. include:: /includes/atlas-connect-blurb.rst
4641
47- .. code-block:: swift
42+ .. tabs::
43+ 
44+    .. tab:: Synchronous API
45+       :tabid: swift-sync
46+ 
47+       .. code-block:: swift
48+ 
49+          import MongoSwiftSync
50+ 
51+          defer {
52+              // free driver resources
53+              cleanupMongoSwift()
54+          }
55+ 
56+          let client = try MongoClient("mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority")
57+          let db = client.db("myDB")
58+ 
59+          // your application logic
60+ 
61+    .. tab:: Asynchronous API
62+       :tabid: swift-async
63+ 
64+       .. code-block:: swift
65+ 
66+          import MongoSwift
67+          import NIO
68+ 
69+          let elg = MultiThreadedEventLoopGroup(numberOfThreads: 4)
70+          let client = try MongoClient(
71+              "mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority",
72+              using: elg
73+          )
74+ 
75+          defer {
76+              // clean up driver resources
77+              try? client.syncClose()
78+              cleanupMongoSwift()
4879
49-    import MongoSwift
80+              // shut down EventLoopGroup
81+              try? elg.syncShutdownGracefully()
82+          }
5083
51-    let client = try MongoClient("mongodb+srv://<username>:<password>@<cluster-url>/test?retryWrites=true&w=majority")
52-    let db = client.db("test")
84+          let db = client.db("myDB")
5385
54-    // your application logic
55-    // free all resources
56-    cleanupMongoSwift()
86+          // your application logic
5787
5888Compatibility
5989-------------
0 commit comments