Skip to content

Commit 945e6d9

Browse files
committed
test(NODE-6765): add type test for aggregation in findOneAndUpdate
1 parent ac151f3 commit 945e6d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/types/community/collection/findX.test-d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,14 @@ expectType<WithId<{ a: number; b: string }> | null>(
388388
}
389389
)
390390
);
391+
392+
// the update operator can be an aggregation pipeline
393+
expectType<WithId<{ a: number; b: string }> | null>(
394+
await coll.findOneAndUpdate({ a: 3 }, [
395+
{
396+
$set: {
397+
a: 5
398+
}
399+
}
400+
])
401+
);

0 commit comments

Comments
 (0)