Skip to content

Commit

Permalink
fix(NODE-4129): constrain watch type parameter to extend `ChangeStr…
Browse files Browse the repository at this point in the history
…eam` type parameter (#3183)
  • Loading branch information
eps1lon committed Mar 30, 2022
1 parent 5132bc9 commit 43ba9fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/collection.ts
Expand Up @@ -1422,7 +1422,7 @@ export class Collection<TSchema extends Document = Document> {
* @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<TLocal = TSchema>(
watch<TLocal extends Document = TSchema>(
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TLocal> {
Expand Down
2 changes: 1 addition & 1 deletion src/db.ts
Expand Up @@ -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<TSchema = Document>(
watch<TSchema extends Document = Document>(
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TSchema> {
Expand Down
2 changes: 1 addition & 1 deletion src/mongo_client.ts
Expand Up @@ -590,7 +590,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
* @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<TSchema = Document>(
watch<TSchema extends Document = Document>(
pipeline: Document[] = [],
options: ChangeStreamOptions = {}
): ChangeStream<TSchema> {
Expand Down

0 comments on commit 43ba9fc

Please sign in to comment.