From a299a0bf30decef451b4fd3218ea2c9719fd962e Mon Sep 17 00:00:00 2001 From: Eric Adum Date: Wed, 1 Sep 2021 11:21:00 -0400 Subject: [PATCH] fix(NODE-3567): correct typing on aggregation out helper (#2967) --- src/cursor/aggregation_cursor.ts | 4 ++-- test/types/mongodb.test-d.ts | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cursor/aggregation_cursor.ts b/src/cursor/aggregation_cursor.ts index 2f293c852e..6efae2035c 100644 --- a/src/cursor/aggregation_cursor.ts +++ b/src/cursor/aggregation_cursor.ts @@ -120,8 +120,8 @@ export class AggregationCursor extends AbstractCursor(x => x.toString()); expectType>(composedMap); expectType(await composedMap.next()); expectType(await composedMap.toArray()); + +const builtCursor = coll.aggregate(); +expectType>(builtCursor.out('string')); // should allow string values for the out helper +expectError(builtCursor.out(1)); // should error on non-string values