Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/mongo_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const closeOperation = require('./operations/mongo_client_ops').closeOperation;
* @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections
* @param {boolean} [options.useNewUrlParser=false] Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future.
* @param {boolean} [options.useUnifiedTopology] Enables the new unified topology layer
* @param {string} [options.cryptdConnectionString] The connection string for mongocryptd
* @param {AutoEncryptionOptions} [options.autoEncryption] Optionally enable client side auto encryption
* @param {MongoClient~connectCallback} [callback] The command result callback
* @return {MongoClient} a MongoClient instance
Expand Down
10 changes: 6 additions & 4 deletions lib/operations/mongo_client_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,12 @@ function createTopology(mongoClient, topologyType, options, callback) {
}

const MongoClient = loadClient();
const connectionString =
os.platform() === 'win32'
? 'mongodb://localhost:27020/?serverSelectionTimeoutMS=1000'
: 'mongodb://%2Ftmp%2Fmongocryptd.sock/?serverSelectionTimeoutMS=1000';
let connectionString =
Comment thread
rosemaryy marked this conversation as resolved.
Outdated
mongoClient.s.options.cryptdConnectionString != null
? mongoClient.s.options.cryptdConnectionString
: os.platform() === 'win32'
? 'mongodb://localhost:27020/?serverSelectionTimeoutMS=1000'
: 'mongodb://%2Ftmp%2Fmongocryptd.sock/?serverSelectionTimeoutMS=1000';

const mongocryptdClient = new MongoClient(connectionString, { useUnifiedTopology: true });
mongocryptdClient.connect(err => {
Expand Down