[GODRIVER-591] ChangeStream option BatchSize is passed to the pipeline stage instead to the cursor Created: 08/Oct/18  Updated: 28/Oct/23  Resolved: 27/Nov/18

Status: Closed
Project: Go Driver
Component/s: CRUD
Affects Version/s: None
Fix Version/s: 0.1.0

Type: Bug Priority: Major - P3
Reporter: Wan Bachtiar Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: beta
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

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



 Comments   
Comment by Githook User [ 27/Nov/18 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: Add helpers to create database and client change streams.

GODRIVER-437
GODRIVER-469
GODRIVER-591

Change-Id: I52270279e9ea05c1e64e5ec3d9d8a86478cd9986
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/f0d2014f595ef724540c224188c776086437c3e7

Generated at Thu Feb 08 08:34:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.