File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
test/integration/retryable-reads Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -524,6 +524,9 @@ export class Collection<TSchema extends Document = Document> {
524524 options : Omit < FindOneOptions , '' > & Abortable = { }
525525 ) : Promise < WithId < TSchema > | null > {
526526 const opts = { ...options } ;
527+ // Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec.
528+ // noCursorTimeout must be unset as well as batchSize.
529+ // See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details
527530 opts . singleBatch = true ;
528531 if ( opts . noCursorTimeout != null ) {
529532 delete opts . noCursorTimeout ;
@@ -533,16 +536,6 @@ export class Collection<TSchema extends Document = Document> {
533536 }
534537 const cursor = this . find ( filter , opts ) . limit ( 1 ) ;
535538 return await cursor . next ( ) ;
536- //await cursor.close();
537- //return await executeOperation(
538- // this.client,
539- // new FindOneOperation(
540- // this.s.db,
541- // this.collectionName,
542- // filter,
543- // resolveOptions(this as TODO_NODE_3286, options)
544- // )
545- //);
546539 }
547540
548541 /**
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const UNIMPLEMENTED_APIS = [
1414
1515const skippedTests = [ 'collection.listIndexes succeeds after retryable handshake network error' ] ;
1616
17- describe . only ( 'Retryable Reads (unified)' , function ( ) {
17+ describe ( 'Retryable Reads (unified)' , function ( ) {
1818 runUnifiedSuite ( loadSpecTests ( path . join ( 'retryable-reads' , 'unified' ) ) , ( { description } ) => {
1919 for ( const apiName of UNIMPLEMENTED_APIS ) {
2020 if ( description . toLowerCase ( ) . includes ( apiName . toLowerCase ( ) ) ) {
You can’t perform that action at this time.
0 commit comments