-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Minor Change
Starting with PyMongo 3.0 read preferences will be a class instead of an integer representing the mode of the preference. A separate class will exist for each preference, with all preferences other than Primary accepting tag sets as an optional parameter (primary preference is incompatible with tag sets).
The tag_sets attribute of MongoClient, Database, and Collection will be removed and become a part of compatible read preference instances instead.
The read_preferences.ReadPreference global will continue to exist in a mostly backward compatible way, though its attributes will be instances of the read preference classes instead of integers. The change should only be backward breaking for applications that currently use tag_sets.