The min_wire_version and max_wire_version attributes have
always been racy when connected to a mixed version replica set
or any sharded cluster. When connected to a mongos all you know
is the wire version of that mongos, not the shards behind it.
With mongos load balancing this problem is even worse, since
each operation could possibly be executed on a different mongo
version during an upgrade.
With this change the max_pool_size named parameter to
MongoClient is removed. It is replaced by the maxPoolSize
MongoDB URI option, which can be passed in a URI, or as a
keyword argument to MongoClient.
- Move ReturnDocument to pymongo.collection.
- Change ReturnDocument.Before to ReturnDocument.BEFORE
- Change ReturnDocument.After to ReturnDocument.AFTER
- Add pymongo.cursor.CursorType.
- Move pymongo.cursor.NON_TAILABLE and friends to attributes of CursorType.
- read_preferences.ReadPreference is once again an "enum".
- Fix docs for read_preferences.ReadPreference.
- Rename pymongo.options to pymongo.operations.
- Export CursorType, ReturnDocument, WriteConcern, and public classes
from pymongo.opertions through pymongo/__init__.py
- Fix up a number of documentation issues in the process.
The ``alive`` method is removed since it no longer
provides meaningful information; even if the client is disconnected,
it may discover a server in time to fulfill the next operation.
It failed when the replica set config contains hostnames that differ from the
DB_IP environment variable that PyMongo's tests use. E.g. if DB_IP is
"127.0.0.1" but the replica set is configured to use hostnames like
"localhost:27017", then test_init_disconnected failed because the tests' global
"host" variable is "127.0.0.1" but MongoClient.host is "localhost".
- Changed parameter names (default values and behaviors remain the same):
- spec (spec_or_id in find_one) -> filter
- fields -> projection
- partial -> allow_partial_results
- The "timeout" option is renamed to "no_cursor_timeout" with its default
changed to False.
- The tailable, await_data, and exhaust options will be replaced with a
cursor_type option. Valid values:
- cursor.NON_TAILABLE
- cursor.TAILABLE
- cursor.TAILABLE_AWAIT
- cursor.EXHAUST
- The following options are added:
- oplog_replay (bool - default False) - only valid with tailable cursors
against the oplog.
- modifiers (document - default None) - A dict of query modifiers. See
http://docs.mongodb.org/manual/reference/operator/query-modifier/#modifiers for
options.
- The following options are removed, replaced by the "modifiers" option:
- max_scan
- snapshot
- The as_class option is removed. Use Collection.with_options instead.
It isn't testing anything, and it can interfere with later tests: on Mac,
there's a global getaddrinfo lock. TestClientLazyConnectBadSeeds
starts 10 threads and doesn't join them, so they're still vying for the
lock as the next tests run.
Rename the attributes of IsMaster, ServerDescription, TopologyDescription, and
TopologySettings from "set_name" to "replica_set_name" for greater clarity.