From 98d715a117a9f4a9ac30a6654a388973ddd245c9 Mon Sep 17 00:00:00 2001 From: normanperrin Date: Sun, 21 Oct 2018 11:55:06 -0300 Subject: [PATCH] mongoose: change useCreateIndex position in connect option obj --- types/mongoose/index.d.ts | 10 ++++------ types/mongoose/mongoose-tests.ts | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 19551684e0..ed1b1a04f9 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 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -390,6 +391,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; @@ -408,11 +411,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 20b24ba887..1dfe106296 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;