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);