diff --git a/src/collection.ts b/src/collection.ts index 002d3335d9..0f45359543 100644 --- a/src/collection.ts +++ b/src/collection.ts @@ -1422,7 +1422,7 @@ export class Collection { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch( + watch( pipeline: Document[] = [], options: ChangeStreamOptions = {} ): ChangeStream { diff --git a/src/db.ts b/src/db.ts index 539cbb745d..3632e88427 100644 --- a/src/db.ts +++ b/src/db.ts @@ -722,7 +722,7 @@ export class Db { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch( + watch( pipeline: Document[] = [], options: ChangeStreamOptions = {} ): ChangeStream { diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 90e4fc2188..6a8af89204 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -590,7 +590,7 @@ export class MongoClient extends TypedEventEmitter { * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. * @param options - Optional settings for the command */ - watch( + watch( pipeline: Document[] = [], options: ChangeStreamOptions = {} ): ChangeStream {