Skip to content

Commit

Permalink
fix: min and max take Document parameters, not numbers (#2657)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst authored Dec 4, 2020
1 parent bb883f7 commit 698533f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/cursor/find_cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class FindCursor extends AbstractCursor {
*
* @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.
*/
min(min: number): this {
min(min: Document): this {
assertUninitialized(this);
this[kBuiltOptions].min = min;
return this;
Expand All @@ -189,7 +189,7 @@ export class FindCursor extends AbstractCursor {
*
* @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.
*/
max(max: number): this {
max(max: Document): this {
assertUninitialized(this);
this[kBuiltOptions].max = max;
return this;
Expand Down Expand Up @@ -249,15 +249,15 @@ export class FindCursor extends AbstractCursor {
break;

case 'max':
this[kBuiltOptions].max = value as number;
this[kBuiltOptions].max = value as Document;
break;

case 'maxTimeMS':
this[kBuiltOptions].maxTimeMS = value as number;
break;

case 'min':
this[kBuiltOptions].min = value as number;
this[kBuiltOptions].min = value as Document;
break;

case 'orderby':
Expand Down
8 changes: 4 additions & 4 deletions src/operations/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export interface FindOptions extends CommandOperationOptions {
batchSize?: number;
/** If true, returns only the index keys in the resulting documents. */
returnKey?: boolean;
/** Set index bounds. */
min?: number;
/** Set index bounds. */
max?: number;
/** The inclusive lower bound for a specific index */
min?: Document;
/** The exclusive upper bound for a specific index */
max?: Document;
/** You can put a $comment field on a query to make looking in the profiler logs simpler. */
comment?: string | Document;
/** Number of milliseconds to wait before aborting the query. */
Expand Down

0 comments on commit 698533f

Please sign in to comment.