Streams: set the batch size to 0 on watch calls

XMLWordPrintableJSON

    • Atlas Streams
    • Fully Compatible
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Note: Upgrading the driver version to include CDRIVER-5925 requires a potentially involved libbson upgrade (SERVER-97106). To avoid waiting on this, we should cherry pick the changes made as part of CDRIVER-5925 within our vendored version of the driver (see Kevin's comment).

       

      Setting the batch size of the watch to 0 will allow the server to return immediately and avoid having the operation run on the cluster even if the client crashes or abandons the cursor. 

      mongocxx::options::change_stream options;
      options.batch_size(0); // Send batchSize:0 to aggregate to have aggregate return immediately.
      mongocxx::change_stream stream = collection.watch(options); 

       

       

              Assignee:
              Calvin Nix
              Reporter:
              Andrea Rahmanan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: