mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #25970 from cxcorp/mongoose-add-close-force-overload
Mongoose: Add force close Connection#close variant
This commit is contained in:
Vendored
+3
@@ -236,6 +236,9 @@ declare module "mongoose" {
|
||||
/** Closes the connection */
|
||||
close(callback?: (err: any) => void): Promise<void>;
|
||||
|
||||
/** Closes the connection */
|
||||
close(force?: boolean, callback?: (err: any) => void): Promise<void>;
|
||||
|
||||
/**
|
||||
* Retrieves a collection, creating it if not cached.
|
||||
* Not typically needed by applications. Just talk to your collection through your model.
|
||||
|
||||
@@ -135,7 +135,10 @@ conn1.openUri('mongodb://localhost/test', 'myDb', 27017, {
|
||||
autoIndex: false
|
||||
}
|
||||
}, function (err) {}).open('');
|
||||
conn1.close().catch(function (err) {});
|
||||
conn1.close().then(function () {}).catch(function (err) {});
|
||||
conn1.close(true).then(function () {}).catch(function (err) {});
|
||||
conn1.close(function (err) {});
|
||||
conn1.close(true, function (err) {});
|
||||
conn1.collection('name').$format(999);
|
||||
conn1.model('myModel', new mongoose.Schema({}), 'myCol').find();
|
||||
conn1.models.myModel.findOne().exec();
|
||||
|
||||
Reference in New Issue
Block a user