open() is deprecated in mongoose >= 4.11.0

Breaking change in @Automattic/mongoose
 
dda165eebd (diff-259dec4414a400a6e895f16ff1d0ca3b)
This commit is contained in:
Hasan Tayyar BEŞİK
2018-05-11 10:12:12 +02:00
committed by GitHub
parent 8cd6bba3b3
commit 1762c042d8

View File

@@ -190,6 +190,7 @@ declare module "mongoose" {
/**
* Opens the connection to MongoDB.
* @deprecated open() is deprecated in mongoose >= 4.11.0
* @param mongodb://uri or the host to which you are connecting
* @param database database name
* @param port database port
@@ -200,6 +201,19 @@ declare module "mongoose" {
*/
open(connection_string: string, database?: string, port?: number,
options?: ConnectionOpenOptions, callback?: (err: any) => void): any;
/**
* Opens the connection to MongoDB.
* @param mongodb://uri or the host to which you are connecting
* @param database database name
* @param port database port
* @param options Mongoose forces the db option forceServerObjectId false and cannot be overridden.
* Mongoose defaults the server auto_reconnect options to true which can be overridden.
* See the node-mongodb-native driver instance for options that it understands.
* Options passed take precedence over options included in connection strings.
*/
openUri(connection_string: string, database?: string, port?: number,
options?: ConnectionOpenOptions, callback?: (err: any) => void): any;
/** Helper for dropDatabase() */
dropDatabase(callback?: (err: any) => void): Promise<any>;