Skip to content

Commit 344b9ac

Browse files
committed
Preference to use MongoClient instead of Connection class
1 parent 4700bf2 commit 344b9ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/administration/ssl.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,21 @@ PyMongo
108108
~~~~~~~
109109

110110
Add the "``ssl=True``" parameter to a PyMongo
111-
py:module:`connection <pymongo:pymongo.connection>`
111+
py:module:`MongoClient <pymongo:pymongo.MongoClient>`
112112
to create a MongoDB connection to an SSL MongoDB instance:
113113

114114
.. code-block:: python
115115

116-
from pymongo import Connection
117-
c = Connection(host="mongodb.example.net", port=27017, ssl=True)
116+
from pymongo import MongoClient
117+
c = MongoClient(host="mongodb.example.net", port=27017, ssl=True)
118118

119119
To connect to a replica set, use the following operation:
120120

121121
.. code-block:: python
122122

123-
from pymongo import ReplicaSetConnection
124-
c = ReplicaSetConnection("mongodb.example.net:27017",
125-
replicaSet="mysetname", ssl=True)
123+
from pymongo import MongoReplicaSetClient
124+
c = MongoReplicaSetClient("mongodb.example.net:27017",
125+
replicaSet="mysetname", ssl=True)
126126

127127
PyMongo also supports an "``ssl=true``" option for the MongoDB URI:
128128

0 commit comments

Comments
 (0)