[GODRIVER-805] BSON field '$changeStream.maxAwaitTimeMS' is an unknown field Created: 04/Feb/19  Updated: 28/Oct/23  Resolved: 13/Feb/19

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 0.3.0
Fix Version/s: 1.0.0-rc1

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


 Description   

I could be doing something wrong, but it appears that the maxAwaitTimeMS on a change stream is not always getting converted to maxTimeMs before being sent on the wire.  

var stream *mongo.ChangeStream
 opts := options.ChangeStream()
 opts.SetMaxAwaitTime(time.Duration(10) * time.Second)
 opts.SetFullDocument(options.UpdateLookup)
 opts.SetStartAtOperationTime(startAt)
 c := client.Database("test").Collection("test")
 stream, err = c.Watch(context.Background(), pipeline, opts)

With SetMaxAwaitTime applied I get the following error: 

BSON field '$changeStream.maxAwaitTimeMS' is an unknown field



 Comments   
Comment by Githook User [ 13/Feb/19 ]

Author:

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

Message: Fix MaxAwaitTimeMS implementation for change streams.

GODRIVER-805

Change-Id: Ie31d84652485d59d1865bd11f75de1dcb777c327
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/33f5dc292918066274ff03ebeaf4bfef0b8415e1

Comment by Ryan Wynn [ 04/Feb/19 ]

I'm guessing the conversion needs to be added to the initial aggregate encode?

https://github.com/mongodb/mongo-go-driver/blob/d685dac01f10a738bb94f874071281022cddc55d/x/network/command/aggregate.go#L50

 

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