Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1564

Cannot set use_cursor or batch_size with aggregation cursor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0-rc0
    • Component/s: API
    • Labels:
      None

      Description

      After upgrading to C Driver 1.9.0, the C++ Driver can no longer set use_cursor or batch_size with options::aggregate. If it sets only batch_size, the batch_size is not actually sent with the initial aggregate command. If it sets use_cursor, then the "cursor" field is included in the aggregate command twice, causing a server error.

      The problem arose when the C Driver dropped support for old MongoDB versions. Its aggregate logic changed to always include the cursor field. This obsoletes the C++ driver's use_cursor option and violates the C++ driver's assumption about how to pass batch_size field.

      Remove the use_cursor option, and if batch_size is set then add the "batchSize" field directly to the top level of the "opts" BSON document passed to mongoc_collection_aggregate, rather than wrapping it in a "cursor" document.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: