Skip to content

Commit 698533f

Browse files
authored
fix: min and max take Document parameters, not numbers (#2657)
NODE-2913
1 parent bb883f7 commit 698533f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/cursor/find_cursor.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class FindCursor extends AbstractCursor {
178178
*
179179
* @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order.
180180
*/
181-
min(min: number): this {
181+
min(min: Document): this {
182182
assertUninitialized(this);
183183
this[kBuiltOptions].min = min;
184184
return this;
@@ -189,7 +189,7 @@ export class FindCursor extends AbstractCursor {
189189
*
190190
* @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order.
191191
*/
192-
max(max: number): this {
192+
max(max: Document): this {
193193
assertUninitialized(this);
194194
this[kBuiltOptions].max = max;
195195
return this;
@@ -249,15 +249,15 @@ export class FindCursor extends AbstractCursor {
249249
break;
250250

251251
case 'max':
252-
this[kBuiltOptions].max = value as number;
252+
this[kBuiltOptions].max = value as Document;
253253
break;
254254

255255
case 'maxTimeMS':
256256
this[kBuiltOptions].maxTimeMS = value as number;
257257
break;
258258

259259
case 'min':
260-
this[kBuiltOptions].min = value as number;
260+
this[kBuiltOptions].min = value as Document;
261261
break;
262262

263263
case 'orderby':

src/operations/find.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export interface FindOptions extends CommandOperationOptions {
3838
batchSize?: number;
3939
/** If true, returns only the index keys in the resulting documents. */
4040
returnKey?: boolean;
41-
/** Set index bounds. */
42-
min?: number;
43-
/** Set index bounds. */
44-
max?: number;
41+
/** The inclusive lower bound for a specific index */
42+
min?: Document;
43+
/** The exclusive upper bound for a specific index */
44+
max?: Document;
4545
/** You can put a $comment field on a query to make looking in the profiler logs simpler. */
4646
comment?: string | Document;
4747
/** Number of milliseconds to wait before aborting the query. */

0 commit comments

Comments
 (0)