Details
-
Task
-
Status: Closed
-
Major - P3
-
Resolution: Done
-
None
-
None
-
None
Description
NODE-3917 Description
https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst#directconnection-uri-option-with-multiple-seeds-or-srv-uri says:
The driver MUST report an error if the directConnection=true URI option is specified with multiple seeds.
In reality:
import { MongoClient } from 'mongodb';
|
|
const url = 'mongodb://localhost:27017,localhost:27018,localhost:27019/?directConnection=true&replicaSet=replset';
|
const client = await MongoClient.connect(url);
|
console.log((await client.db('admin').command({ hello: 1 })).hosts);
|
prints [ 'localhost:27017', 'localhost:27018', 'localhost:27019' ] with the 4.3.0 driver. With 3.7.3, this fails as expected (“directConnection option requires exactly one host”).
Attachments
Issue Links
- is depended on by
-
NODE-3917 4.x driver allows directConnection=true with multiple hosts
-
- Closed
-