From 2f0dada64d60fd5fd5d3d82237b6565565f1b4b1 Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Sun, 5 Feb 2023 14:48:05 -0600 Subject: [PATCH] feat: set maxTimeMS to 5s default --- README.md | 2 +- index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a132b0d..4461f54 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ You should use [@ladjs/graceful][lad-graceful] to manage process SIGHUP and grac | `debug` | Boolean | If `process.env.MONGOOSE_DEBUG` is truthy, then it is `true`, otherwise `false` | set with [mongoose.set][mongoose.set] | | `id` | Boolean | undefined | set with [mongoose.set][mongoose.set] | | `timestamps.createdAt.immutable` | Boolean | undefined | set with [mongoose.set][mongoose.set] | -| `maxTimeMS` | Boolean | undefined | set with [mongoose.set][mongoose.set] | +| `maxTimeMS` | Number | `5000` | set with [mongoose.set][mongoose.set] | | `objectIdGetter` | Boolean | undefined | set with [mongoose.set][mongoose.set] | | `overwriteModels` | Boolean | undefined | set with [mongoose.set][mongoose.set] | | `returnOriginal` | Boolean | undefined | set with [mongoose.set][mongoose.set] | diff --git a/index.js b/index.js index 37593fd..e245400 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,8 @@ class Mongoose { }, debug: boolean(process.env.MONGOOSE_DEBUG), strict: true, - strictQuery: false + strictQuery: false, + maxTimeMS: 5000 // default 5s timeout for a query to complete }, config );