Skip to content

Commit 7f71239

Browse files
committed
fix: add constraints to client and collection
1 parent 4b73433 commit 7f71239

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ export class Collection<TSchema extends Document = Document> {
14221422
* @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.
14231423
* @param options - Optional settings for the command
14241424
*/
1425-
watch<TLocal = TSchema>(
1425+
watch<TLocal extends Document = TSchema>(
14261426
pipeline: Document[] = [],
14271427
options: ChangeStreamOptions = {}
14281428
): ChangeStream<TLocal> {

src/mongo_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
590590
* @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.
591591
* @param options - Optional settings for the command
592592
*/
593-
watch<TSchema = Document>(
593+
watch<TSchema extends Document = Document>(
594594
pipeline: Document[] = [],
595595
options: ChangeStreamOptions = {}
596596
): ChangeStream<TSchema> {

0 commit comments

Comments
 (0)