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 @@ -552,6 +552,9 @@ export class Collection<TSchema extends Document = Document> {
552
552
options : Omit < FindOneOptions , '' > & Abortable = { }
553
553
) : Promise < WithId < TSchema > | null > {
554
554
const opts = { ...options } ;
555
+ // Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec.
556
+ // noCursorTimeout must be unset as well as batchSize.
557
+ // See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details
555
558
opts . singleBatch = true ;
556
559
if ( opts . noCursorTimeout != null ) {
557
560
delete opts . noCursorTimeout ;
@@ -561,16 +564,6 @@ export class Collection<TSchema extends Document = Document> {
561
564
}
562
565
const cursor = this . find ( filter , opts ) . limit ( 1 ) ;
563
566
return await cursor . next ( ) ;
564
- //await cursor.close();
565
- //return await executeOperation(
566
- // this.client,
567
- // new FindOneOperation(
568
- // this.s.db,
569
- // this.collectionName,
570
- // filter,
571
- // resolveOptions(this as TODO_NODE_3286, options)
572
- // )
573
- //);
574
567
}
575
568
576
569
/**
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const UNIMPLEMENTED_APIS = [
14
14
15
15
const skippedTests = [ 'collection.listIndexes succeeds after retryable handshake network error' ] ;
16
16
17
- describe . only ( 'Retryable Reads (unified)' , function ( ) {
17
+ describe ( 'Retryable Reads (unified)' , function ( ) {
18
18
runUnifiedSuite ( loadSpecTests ( path . join ( 'retryable-reads' , 'unified' ) ) , ( { description } ) => {
19
19
for ( const apiName of UNIMPLEMENTED_APIS ) {
20
20
if ( description . toLowerCase ( ) . includes ( apiName . toLowerCase ( ) ) ) {
You can’t perform that action at this time.
0 commit comments