-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Change Streams
What problem are you facing?
maxTimeMS or maxAwaitTimeMS are not passed through to getMore or aggregate calls for change streams, resulting in the server default always being used.
Steps to reproduce?
- Spin up a new replica set
- Update the script below with the correct connection string
- Run the script and observe than neither maxAwaitTimeMS or maxAwaitMS get sent in any of the commands
import { MongoClient } from './src'; async function main() { const client = new MongoClient( 'mongodb://bob:pwd123@localhost:31000,localhost:31001,localhost:31002/?replicaSet=rs', { monitorCommands: true } ); client.on('commandStarted', ({ command }) => console.debug(command)); await client.connect(); const cs = client .db('test') .collection('test') .watch([], { maxAwaitTimeMS: 4000, maxTimeMS: 6000 }); cs.on('change', console.log); } main();