@@ -7,6 +7,7 @@ import { type Filter, TypedEventEmitter } from '../mongo_types';
77import type { ReadPreference } from '../read_preference' ;
88import type { Sort } from '../sort' ;
99import { CSOTTimeoutContext } from '../timeout' ;
10+ import { resolveOptions } from '../utils' ;
1011import { WriteConcern , type WriteConcernOptions } from '../write_concern' ;
1112import type { FindOptions } from './../operations/find' ;
1213import {
@@ -155,7 +156,7 @@ export class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {
155156 * @param id - The id of the file doc
156157 */
157158 async delete ( id : ObjectId , options ?: { timeoutMS : number } ) : Promise < void > {
158- const timeoutMS = options ?. timeoutMS ?? this . s . db . timeoutMS ;
159+ const { timeoutMS } = resolveOptions ( this . s . db , options ) ;
159160 let timeoutContext : CSOTTimeoutContext | undefined = undefined ;
160161
161162 if ( timeoutMS ) {
@@ -235,7 +236,7 @@ export class GridFSBucket extends TypedEventEmitter<GridFSBucketEvents> {
235236
236237 /** Removes this bucket's files collection, followed by its chunks collection. */
237238 async drop ( options ?: { timeoutMS : number } ) : Promise < void > {
238- const timeoutMS = options ?. timeoutMS ?? this . s . db . timeoutMS ;
239+ const { timeoutMS } = resolveOptions ( this . s . db , options ) ;
239240 let timeoutContext : CSOTTimeoutContext | undefined = undefined ;
240241
241242 if ( timeoutMS ) {
0 commit comments