Skip to content

Commit feaeb6b

Browse files
committed
chore: bring back negative limit check
1 parent 95cd6b1 commit feaeb6b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/operations/find.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,12 @@ function makeFindCommand(ns: MongoDBNamespace, filter: Document, options: FindOp
185185
}
186186

187187
if (typeof options.limit === 'number') {
188-
findCommand.limit = options.limit;
188+
if (options.limit < 0) {
189+
findCommand.limit = -options.limit;
190+
findCommand.singleBatch = true;
191+
} else {
192+
findCommand.limit = options.limit;
193+
}
189194
}
190195

191196
if (typeof options.batchSize === 'number') {

0 commit comments

Comments
 (0)