-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.4
-
Component/s: drivers
-
Labels:
Hi Team
Here https://docs.mongodb.com/drivers/node/faq/#how-can-i-prevent-long-running-operations-from-slowing-down-the-server- it is mentioned that one can pass maxTimeMS option setting in MongoClient constructor to apply this to all the operations called by the client but on using this option it is showing this message:
the options [maxTimeMS] is not supported
Script:
const mongodb = require('mongodb'); const { MongoClient } = mongodb; const client = new MongoClient('mongodb://localhost:27017/db', { maxTimeMS: 1000, useUnifiedTopology: true }); client.connect().then(() => { console.log('connected'); }) .catch(err => console.error('connection err:', err)) .finally(() => { client.close(); });
Mongodb driver version: 3.6.4
NodeJs version: 12.6.1
Platform: MacOS Big Sur