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

Batch size is not used to determine size of result set to a query

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Any
    • Backwards Compatibility:
      Fully Compatible

      Description

      Unless a limit is set on a query, pymongo passes 0 as numToReturn (see http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPQUERY), even if a batch size is set. This means the first results from a query are the lesser of 101 documents or 1 megabyte of data (see https://github.com/mongodb/mongo/blob/master/db/ops/query.h#L122)

      Desired logic is:

      if both batch_size and limit are set, set numToReturn = min(batch_size, limit)
      if either but not both are set, set numToReturn to that value
      else set numToReturn to 0

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: