diff --git a/types/mongodb/index.d.ts b/types/mongodb/index.d.ts index ebe427a427..18e627ebfc 100644 --- a/types/mongodb/index.d.ts +++ b/types/mongodb/index.d.ts @@ -994,7 +994,7 @@ export interface WriteOpResult { //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#~resultCallback export type CursorResult = any | void | boolean; -type Default = { [key: string]: any }; +type Default = any; //http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html export class Cursor extends Readable { diff --git a/types/mongodb/mongodb-tests.ts b/types/mongodb/mongodb-tests.ts index e4c7f3bd8a..549537812d 100644 --- a/types/mongodb/mongodb-tests.ts +++ b/types/mongodb/mongodb-tests.ts @@ -85,7 +85,7 @@ let options = { let cursor: mongodb.Cursor = collection.find({color: 'black'}) cursor.toArray(function (err,r) { r[0].cost} ); cursor.forEach(function (bag ) { bag.color }, () => {}); - collection.findOne({ color: 'white' }).then(() => { }) + collection.findOne({ color: 'white' }).then(b => { let _b:bag = b; }) collection.findOne({ color: 'white' }).then(b => { b.cost; }) } {