Skip to content

Commit 5e8db6d

Browse files
committed
correctly propagate timeoutMode
1 parent 494992e commit 5e8db6d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/cursor/abstract_cursor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export abstract class AbstractCursor<
218218
) {
219219
throw new MongoAPIError("Cannot set tailable cursor's timeoutMode to LIFETIME");
220220
}
221+
this.cursorOptions.timeoutMode = options.timeoutMode;
221222
}
222223
}
223224

src/cursor/aggregation_cursor.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ export class AggregationCursor<TSchema = any> extends AbstractCursor<TSchema> {
4545
if (
4646
this.cursorOptions.timeoutMS != null &&
4747
this.cursorOptions.timeoutMode === CursorTimeoutMode.ITERATION &&
48-
this.pipeline.filter(stage => {
49-
Object.hasOwn(stage, '$out') || Object.hasOwn(stage, '$merge');
50-
}).length > 0
48+
this.pipeline.filter(s => s.$out != null || s.$merge != null).length > 0
5149
)
5250
throw new MongoAPIError('Cannot use $out or $merge stage with ITERATION timeoutMode');
5351
}

0 commit comments

Comments
 (0)