diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 79b5c553fb..92447c3e9d 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.2.13 +// Type definitions for Mongoose 5.3.4 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -13,6 +13,7 @@ // Idan Dardikman // Dominik Heigl // Fazendaaa +// Norman Perrin // Dan Manastireanu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -391,6 +392,8 @@ declare module "mongoose" { useNewUrlParser?: boolean; /** Set to false to make findOneAndUpdate() and findOneAndRemove() use native findOneAndUpdate() rather than findAndModify(). */ useFindAndModify?: boolean; + /** If true, this connection will use createIndex() instead of ensureIndex() for automatic index builds via Model.init(). */ + useCreateIndex?: boolean; // TODO safe?: any; @@ -409,11 +412,6 @@ declare module "mongoose" { * models associated with this connection. */ autoIndex?: boolean; - - /** - * If true, this connection will use createIndex() instead of ensureIndex() for automatic index builds via Model.init(). - */ - useCreateIndex?: boolean; }; } diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index a57d3d085a..da5daf7266 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -22,12 +22,12 @@ const connection2: Promise = mongoose.connect(connectUri, { pass: 'housan', config: { autoIndex: true, - useCreateIndex: true, }, mongos: true, bufferCommands: false, useNewUrlParser: true, useFindAndModify: true, + useCreateIndex: true }); const connection3: null = mongoose.connect(connectUri, function (error) { error.stack;