From 567d8c19bff05c4d5edfcff1f04ff5e7804412ce Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Wed, 6 Jul 2022 15:57:02 -0400 Subject: [PATCH] fix: allow passing of autoIndex mongoose connectionOptions (#722) --- src/mongoose/connect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mongoose/connect.ts b/src/mongoose/connect.ts index 06f1c9b182..c547107adc 100644 --- a/src/mongoose/connect.ts +++ b/src/mongoose/connect.ts @@ -11,9 +11,9 @@ const connectMongoose = async ( let urlToConnect = url; let successfulConnectionMessage = 'Connected to Mongo server successfully!'; const connectionOptions = { + autoIndex: true, ...options, useNewUrlParser: true, - autoIndex: true, }; if (process.env.NODE_ENV === 'test' || process.env.MEMORY_SERVER) {