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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Blocker - P1
    • 1.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Hannes Magnusson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: