Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-411

find() with a limit ignores documents not fitting in the initial batch

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 1.0.0
    • Affects Version/s: None
    • Component/s: None
    • None

      calling mongoc_collection_find() with batch_size of 0 and a limit of 10000 will set the wireprotocol numberToReturn to -10000.
      When setting a batch_size, it also seems to be passed in as a negative number to numberToReturn for unknown reason.

      This does not work. If the collection has plenty big collections MongoDB will only send it data fitting into the initial reply and then ignore everything after that.
      This is why all drivers set numberToReturn to 0, or positive number, not a negative number by default.

            Assignee:
            Unassigned Unassigned
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: