PyMongo 2.x supports secondary_acceptable_latency_ms as an option to methods throughout the driver, but mongos only supports a global latency option. PyMongo 3.x has changed to match the behavior of mongos, allowing migration from a single server, to a replica set, to a sharded cluster without a surprising change in server selection behavior.
secondary_acceptable_latency_ms is deprecated in this version of PyMongo and removed in PyMongo 3. Use the localThresholdMS option with MongoClient or MongoReplicaSetClient instead. See the PyMongo 3 Migration Guide for more information.
secondary_acceptable_latency_ms¶ Any replica-set member whose ping time is within secondary_acceptable_latency_ms of the nearest member may accept reads. Defaults to 15 milliseconds. See ReadPreference. New in version 2.3. write_concern¶ The default write concern for this instance. Supports dict style access for getting/setting write concern options.
Changed in version 3.0: Removed the as_class, fields, uuid_subtype, tag_sets, and secondary_acceptable_latency_ms option. Removed compile_re option: PyMongo now always represents BSON regular expressions as Regex objects. Use try_compile() to attempt to convert from a BSON regular expression to a Python regular expression object.
PyMongo is now tested against a wider array of operating systems and CPU architectures (including s390x, ARM64, and POWER8). … secondary_acceptable_latency_ms (use the localThresholdMS URI option instead) max_scan (use the new modifiers option instead) snapshot …
secondary_acceptable_latency_ms¶ Any replica-set member whose ping time is within secondary_acceptable_latency_ms of the nearest member may accept reads. Defaults to 15 milliseconds. See ReadPreference. New in version 2.3.
Changed in version 3.0: Removed the as_class, fields, uuid_subtype, tag_sets, and secondary_acceptable_latency_ms option. Removed compile_re option: PyMongo now always represents BSON regular expressions as Regex objects. Use try_compile() to attempt to convert from a BSON regular expression to a Python regular expression object.
Removed the network_timeout, read_preference, tag_sets, secondary_acceptable_latency_ms , max_scan, snapshot, tailable, await_data, exhaust, as_class, and slave_okay parameters. Removed compile_re option: PyMongo now always represents BSON regular expressions as Regex objects.
Same for SECONDARY_PREFERRED, unless only the primary is up, in which case read from primary. So if you set read preference SECONDARY_PREFERRED and secondary_acceptable_latency_ms to .001 (since zero isn’t allowed), you’ll only read from the secondary with least latency as measured by the driver. A. Jesse Jiryu Davis Nov 26 ’12 at 22:08, The gridfs package is an implementation of GridFS on top of pymongo , exposing a file-like interface. See also. The MongoDB documentation on. … Changed in version 3.0: Removed the read_preference, tag_sets, and secondary_acceptable_latency_ms options. New in version 2.7. See also.