This change uses a cursor to download all the chunks in a GridFS file
instead of using individual find_one operations to read each chunk.
Detect truncated/missing/extra chunks in _GridOutChunkIterator.
Only detect extra chunks after reading the final chunk, not on every
call to read().
Retry once after CursorNotFound for backward compatibility.
- Deprecate ensure_index
- Remove caching from create_index
- In create_index, remove support for the cache_for param, and the
bucket_size and drop_dups aliases (they all remain in ensure_index)
- GridFS uses create_index
- Fix up tests.
- 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.
This change removes the read_preference parameter from various
command helpers on the Collection object. Those options were
never shipped in a PyMongo release. It also documents which
helpers obey Collection.read_preference.
The bigger change is the removal of the read_preference, tag_sets,
and secondary_acceptable_latency_ms params from find() and find_one()
- a major backward breaking change. Collection.with_options
is intended to replace their use.
coll.find(read_preference=ReadPreference.SECONDARY)
changes to
coll.with_options(read_preference=ReadPreference.SECONDARY).find()
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.
Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
This commit does a few things:
- Adds tag_sets back (deprecated)
- Adds secondary_acceptable_latency_ms back (deprecated)
- Makes acceptable latency a per read preference setting
- Cleans up read preference instance generation
- Adds latencyThresholdMS as an alias for secondaryAcceptableLatencyMS.
The name may change before 3.0 is released.
This commit introduces the following changes:
- Each read preference is now a class.
- Read preferences other than Primary accept a tag_sets parameter.
- The tag_sets attribute of MongoClient, Database, and Collection has
been removed. Use the tag_sets parameter of the new classes instead.
- The read_preferences.ReadPreference constant still exists and should
continue to work as expected for most users.
- Renamed to acceptableLatencyMS since it is also used
in choosing a new mongos during mongos HA failover.
- Moved to a global immutable setting. The expectation is
that the value would be determined by a network/system
admin. Changing it per operation doesn't make a lot of
sense.
Note - it's possible the name of this option may change again
before 3.0 is released.