Skip to content

Commit

Permalink
Added useCreateIndex: true option to the Mongoose connection options …
Browse files Browse the repository at this point in the history
…to address deprecation warnings from the MongoDB driver.
  • Loading branch information
Mattkins committed Oct 24, 2019
1 parent 5c664ff commit feb6cbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function fastifyMongoose (fastify, options, next) {
const opt = Object.assign({}, options, {
promiseLibrary: Bluebird,
useNewUrlParser: true,
useUnifiedTopology: true
useUnifiedTopology: true,
useCreateIndex: true
})

mongoose.connect(uri, opt)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastify-mongoose",
"version": "0.2.2",
"version": "0.2.3",
"description": "Fastify Mongoose connection plugin",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit feb6cbf

Please sign in to comment.