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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1
    • Affects Version/s: 2.0.1
    • Component/s: None
    • None
    • Environment:
      Any
    • Fully Compatible

      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

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

              Created:
              Updated:
              Resolved: