File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,25 @@ information about MMS configuration.
94
94
PyMongo
95
95
~~~~~~~
96
96
97
- Add the "``ssl=true`` parameter to a PyMongo connection to create a
97
+ Add the "``ssl=True``" parameter to a PyMongo connection to create a
98
98
MongoDB connection to an SSL MongoDB instance:
99
99
100
100
.. code-block:: python
101
101
102
102
from pymongo import Connection
103
- c = Connection( host="mongodb.example.net", port=27017, ssl=True )
103
+ c = Connection(host="mongodb.example.net", port=27017, ssl=True)
104
+
105
+ Do the following if you're connecting to a replica set:
106
+
107
+ .. code-block:: python
108
+
109
+ from pymongo import ReplicaSetConnection
110
+ c = ReplicaSetConnection("mongodb.example.net:27017",
111
+ replicaSet="mysetname", ssl=True)
112
+
113
+ PyMongo also supports an "``ssl=true``" option for the MongoDB URI::
114
+
115
+ mongodb://mongodb.example.net:27017/?ssl=true
104
116
105
117
Java
106
118
~~~~
@@ -184,4 +196,4 @@ To connect to a replica set via SSL, use the following form:
184
196
{rs_name:RS.name, ssl:ssl}
185
197
);
186
198
187
- .. _`node-mongodb-native1 `: https://github.com/mongodb/node-mongodb-native
199
+ .. _`node-mongodb-native `: https://github.com/mongodb/node-mongodb-native
You can’t perform that action at this time.
0 commit comments