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:
      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.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: