-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Major Change
MongoClient has a large-ish number of read only attributes, some with values that were defined at creation time, some that provide information about the connected topology. The MongoClient configuration attributes (max_pool_size, min_pool_size, max_idle_time_ms, local_threshold_ms, server_selection_timeout, etc.) only represent a small number of the possible URI options. The attributes that expose limits of a connected server (max_bson_size, max_message_size, max_write_batch_size, etc.) are potentially misleading since they can vary from mongod instance to instance in a mixed version replica set, and may not represent the limits of the shards behind a connected mongos. They are a vestige of prehistoric versions of MongoClient (called Connection back then) that only connected to a single mongod.
Let's rethink all of this for PyMongo 4.0. If we want to expose the values used to configure the MongoClient instance, we can just expose them all in one attribute (sans read_concern, read_preference and write_concern which have to remain). For topology information we should probably just deprecate and delete the attributes, adding documentation and examples for how to access the information for each topology member.
- is related to
-
PYTHON-2981 Stop using MongoClient.address for hashing and equality
- Closed
-
PYTHON-2966 MongoClient.event_listeners does not work as documented
- Closed
-
PYTHON-2988 [3.13] Deprecate MongoClient max_bson_size/max_message_size/max_write_batch_size
- Closed
-
PYTHON-1484 MongoClient option validators should not change option values
- Backlog
- related to
-
PYTHON-2480 Add MongoClient helper to access the current TopologyDescription
- Closed