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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 2.0.1
    • 2.1
    • None
    • None
    • Any
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: