Skip to content

Commit cc4f4f1

Browse files
committed
chore: address comments
1 parent fa130a9 commit cc4f4f1

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

src/collection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,9 @@ export class Collection<TSchema extends Document = Document> {
551551
filter: Filter<TSchema> = {},
552552
options: Omit<FindOneOptions, 'timeoutMode'> & Abortable = {}
553553
): Promise<WithId<TSchema> | null> {
554-
const opts = { ...options };
555554
// Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec.
556555
// noCursorTimeout must be unset as well as batchSize.
557556
// See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details
558-
opts.singleBatch = true;
559557
const { batchSize: _batchSize, noCursorTimeout: _noCursorTimeout, ...opts } = options;
560558
opts.singleBatch = true;
561559
const cursor = this.find(filter, opts).limit(1);

src/operations/find.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ function makeFindCommand(ns: MongoDBNamespace, filter: Document, options: FindOp
202202
) {
203203
findCommand.limit = -options.batchSize;
204204
}
205-
206-
findCommand.singleBatch = true;
207205
} else {
208206
if (options.batchSize === options.limit) {
209207
// Spec dictates that if these are equal the batchSize should be one more than the

0 commit comments

Comments
 (0)