ChangeStream option BatchSize is passed to the pipeline stage instead to the cursor

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.1.0
    • Affects Version/s: None
    • Component/s: CRUD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The BatchSize change stream option is passed into $changestream aggregation pipeline instead to the cursor of the aggregation within Watch().

      When performing:

      	changeStreamOpts := changestreamopt.BundleChangeStream(changestreamopt.BatchSize(1000))
      	cursor, err := collection.Watch(context.Background(), nil, changeStreamOpts)
      

      Resulting in error message:

      2018/10/08 14:53:47 (Location40415) BSON field '$changeStream.batchSize' is an unknown field.
      

      Looking at the code
      https://github.com/mongodb/mongo-go-driver/blob/v0.0.15/mongo/change_stream.go#L66-L73

      only maxAwaitTimeMS is passed to the cursor, but batchSize is passed into the pipeline operator.

       

      This affects current version 0.0.15

            Assignee:
            Divjot Arora (Inactive)
            Reporter:
            Wan Bachtiar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: