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

Change the find() method limit default to None

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      As reported in PYTHON-1762, the default of 0 is confusing. It implies that by default you get no results, or at the very least that it's possible to get no results on purpose. In reality 0 means "all results" in MongoDB. Let's change PyMongo's default to None, and change the validator to require a non-zero value (negative values are also valid, for backward compatibility with pre-3.4 versions of MongoDB) to make it clear you can't request 0 results.

      This is a backward breaking change since 0 has been the default since the very first version of PyMongo. We can't make this change until 4.0.

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

              Created:
              Updated:
              Resolved: