Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-672

Make read preference a class

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 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.

            bernie@mongodb.com Bernie Hackett
            bernie@mongodb.com Bernie Hackett
            0 Vote for this issue
            1 Start watching this issue