mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-14 05:10:09 +08:00
Merge pull request #26057 from ethanresnick/mongoose-connection-patch
feat(mongoose): Document Connection.then/catch
This commit is contained in:
5
types/mongoose/index.d.ts
vendored
5
types/mongoose/index.d.ts
vendored
@@ -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<Connection>["then"];
|
||||
catch: Promise<Connection>["catch"];
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user