Skip to content

Commit 1efce76

Browse files
committed
chore: address comments
1 parent 93c1d6d commit 1efce76

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
@@ -554,11 +554,9 @@ export class Collection<TSchema extends Document = Document> {
554554
filter: Filter<TSchema> = {},
555555
options: Omit<FindOneOptions, 'timeoutMode'> & Abortable = {}
556556
): Promise<WithId<TSchema> | null> {
557-
const opts = { ...options };
558557
// Explicitly set the limit to 1 and singleBatch to true for all commands, per the spec.
559558
// noCursorTimeout must be unset as well as batchSize.
560559
// See: https://github.com/mongodb/specifications/blob/master/source/crud/crud.md#findone-api-details
561-
opts.singleBatch = true;
562560
const { batchSize: _batchSize, noCursorTimeout: _noCursorTimeout, ...opts } = options;
563561
opts.singleBatch = true;
564562
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)