From fddd7126b83dd03869ae54b0e2350db613ce7450 Mon Sep 17 00:00:00 2001 From: Haotian Chai Date: Mon, 10 Dec 2018 20:46:20 +0800 Subject: [PATCH] add autoIndex at top level of connection options According to mongoose api doc of 5.3.15, autoIndex is set at the top level of connection options object. --- types/mongoose/index.d.ts | 1 + types/mongoose/mongoose-tests.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 83aaa33b2b..87ce57f05c 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -424,6 +424,7 @@ declare module "mongoose" { */ autoIndex?: boolean; }; + autoIndex?: boolean; } /** See the node-mongodb-native driver instance for options that it understands. */ diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index f4fec31101..7d23e6be6b 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -27,7 +27,8 @@ const connection2: Promise = mongoose.connect(connectUri, { bufferCommands: false, useNewUrlParser: true, useFindAndModify: true, - useCreateIndex: true + useCreateIndex: true, + autoIndex: true }); const connection3: null = mongoose.connect(connectUri, function (error) { error.stack;