@@ -274,7 +274,7 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
274
274
document_class = dict , tz_aware = False , ** kwargs ):
275
275
"""Create a new connection to a MongoDB replica set.
276
276
277
- The resultant connection object has connection-pooling built
277
+ The resultant client object has connection-pooling built
278
278
in. It also performs auto-reconnection when necessary. If an
279
279
operation fails because of a connection error,
280
280
:class:`~pymongo.errors.ConnectionFailure` is raised. If
@@ -307,7 +307,7 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
307
307
- `max_pool_size` (optional): The maximum number of idle connections
308
308
to keep open in each pool for future use
309
309
- `document_class` (optional): default class to use for
310
- documents returned from queries on this connection
310
+ documents returned from queries on this client
311
311
- `tz_aware` (optional): if ``True``,
312
312
:class:`~datetime.datetime` instances returned as values
313
313
in a document by this :class:`MongoReplicaSetClient` will be timezone
@@ -339,7 +339,7 @@ def __init__(self, hosts_or_uri=None, max_pool_size=10,
339
339
- `connectTimeoutMS`: (integer) How long (in milliseconds) a
340
340
connection can take to be opened before timing out.
341
341
- `ssl`: If ``True``, create the connection to the servers using SSL.
342
- - `read_preference`: The read preference for this connection .
342
+ - `read_preference`: The read preference for this client .
343
343
See :class:`~pymongo.read_preferences.ReadPreference` for available
344
344
- `tag_sets`: Read from replica-set members with these tags.
345
345
To specify a priority-order for tag sets, provide a list of
@@ -598,7 +598,7 @@ def seeds(self):
598
598
@property
599
599
def hosts (self ):
600
600
"""All active and passive (priority 0) replica set
601
- members known to this connection . This does not include
601
+ members known to this client . This does not include
602
602
hidden or slaveDelay members, or arbiters.
603
603
"""
604
604
return self .__hosts
@@ -613,15 +613,15 @@ def primary(self):
613
613
614
614
@property
615
615
def secondaries (self ):
616
- """The secondary members known to this connection .
616
+ """The secondary members known to this client .
617
617
"""
618
618
return set ([
619
619
host for host , member in self .__members .items ()
620
620
if member .is_secondary ])
621
621
622
622
@property
623
623
def arbiters (self ):
624
- """The arbiters known to this connection .
624
+ """The arbiters known to this client .
625
625
"""
626
626
return self .__arbiters
627
627
@@ -665,12 +665,12 @@ def set_document_class(self, klass):
665
665
666
666
document_class = property (get_document_class , set_document_class ,
667
667
doc = """Default class to use for documents
668
- returned on this connection .
668
+ returned from this client .
669
669
""" )
670
670
671
671
@property
672
672
def tz_aware (self ):
673
- """Does this connection return timezone-aware datetimes?
673
+ """Does this client return timezone-aware datetimes?
674
674
"""
675
675
return self .__tz_aware
676
676
@@ -930,7 +930,7 @@ def disconnect(self):
930
930
self .__schedule_refresh ()
931
931
932
932
def close (self ):
933
- """Close this connection instance.
933
+ """Close this client instance.
934
934
935
935
This method first terminates the replica set monitor, then disconnects
936
936
from all members of the replica set. Once called this instance
@@ -961,7 +961,7 @@ def alive(self):
961
961
962
962
A more certain way to determine primary availability is to ping it::
963
963
964
- connection .admin.command('ping')
964
+ client .admin.command('ping')
965
965
966
966
.. _select: http://docs.python.org/2/library/select.html#select.select
967
967
"""
@@ -1264,10 +1264,10 @@ def start_request(self):
1264
1264
"from __future__ import with_statement", :meth:`start_request` can be
1265
1265
used as a context manager:
1266
1266
1267
- >>> connection = pymongo.MongoReplicaSetClient()
1268
- >>> db = connection .test
1267
+ >>> client = pymongo.MongoReplicaSetClient()
1268
+ >>> db = client .test
1269
1269
>>> _id = db.test_collection.insert({})
1270
- >>> with connection .start_request():
1270
+ >>> with client .start_request():
1271
1271
... for i in range(100):
1272
1272
... db.test_collection.update({'_id': _id}, {'$set': {'i':i}})
1273
1273
...
@@ -1356,7 +1356,7 @@ def close_cursor(self, cursor_id, _conn_id):
1356
1356
1357
1357
Raises :class:`TypeError` if `cursor_id` is not an instance of
1358
1358
``(int, long)``. What closing the cursor actually means
1359
- depends on this connection 's cursor manager.
1359
+ depends on this client 's cursor manager.
1360
1360
1361
1361
:Parameters:
1362
1362
- `cursor_id`: id of cursor to close
0 commit comments