diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 310417089f..59a5c95989 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -433,7 +433,7 @@ declare module "mongoose" { $format(arg: any): string; /** Debug print helper */ $print(name: any, i: any, args: any[]): void; - /** Retreives information about this collections indexes. */ + /** Retrieves information about this collections indexes. */ getIndexes(): any; } @@ -451,6 +451,9 @@ declare module "mongoose" { /** Expose the possible connection states. */ static STATES: any; + + then: Promise["then"]; + catch: Promise["catch"]; } /* diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index a43c690572..90b6fc2561 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -37,6 +37,11 @@ const connection3: null = mongoose.connect(connectUri, function (error) { var mongooseConnection: mongoose.Connection = mongoose.createConnection(); mongooseConnection.dropDatabase().then(()=>{}); mongooseConnection.dropCollection('foo').then(()=>{}); +mongoose.createConnection(connectUri).then((conn)=> { + return conn.collections; +}, () => { + +}); mongoose.createConnection(connectUri).open(''); mongoose.createConnection(connectUri, { db: {