From f41b3b4ac070f46ef3f8ef2da3c3a8b6e1223b9b Mon Sep 17 00:00:00 2001 From: kan_a_17 <39461306+Kan-Artem@users.noreply.github.com> Date: Wed, 1 May 2019 09:43:15 +0500 Subject: [PATCH] Mongodb: Fix typos: Cursor#max and Cursor#min (#35120) * Fix typos: Cursor#max and Cursor#min Referring to the documentation I updated types. See [Cursor#min](http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#min) and [Cursor#max](http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#max) * mongodb: fix types --- types/mongodb/index.d.ts | 4 ++-- types/mongodb/mongodb-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index cb96bc1b83..51375d1573 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -1756,7 +1756,7 @@ export class Cursor extends Readable { /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#map */ map(transform: (document: T) => U): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#max */ - max(max: number): Cursor; + max(max: object): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxAwaitTimeMS */ maxAwaitTimeMS(value: number): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxScan */ @@ -1764,7 +1764,7 @@ export class Cursor extends Readable { /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#maxTimeMS */ maxTimeMS(value: number): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#min */ - min(min: number): Cursor; + min(min: object): Cursor; /** http://mongodb.github.io/node-mongodb-native/3.1/api/Cursor.html#next */ next(): Promise; next(callback: MongoCallback): void; diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index b6b539ef9d..9f91486963 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -106,8 +106,8 @@ mongodb.MongoClient.connect(connectionString, options, (err: mongodb.MongoError, cursor = cursor.hint('age_1'); cursor = cursor.limit(1); cursor = cursor.map((result) => {}); - cursor = cursor.max(1); - cursor = cursor.min(1); + cursor = cursor.max({ age: 130 }); + cursor = cursor.min({ age: 18 }); cursor = cursor.maxAwaitTimeMS(1); cursor = cursor.maxScan({}); cursor = cursor.maxTimeMS(1);