Skip to content

Commit 7e79b7f

Browse files
committed
clean
1 parent 99eb0df commit 7e79b7f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/operations/connect.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ function connect(mongoClient, url, options, callback) {
302302
delete _finalOptions.db_options.auth;
303303
}
304304

305+
// `journal` should be translated to `j` for the driver
305306
if (_finalOptions.journal != null) {
306307
if (_finalOptions.writeConcern == null) _finalOptions.writeConcern = {};
307308
_finalOptions.writeConcern.j = _finalOptions.journal;
@@ -643,7 +644,7 @@ function createUnifiedOptions(finalOptions, options) {
643644

644645
// Handle write concern keys separately, since `options` may have the keys at the top level or
645646
// under `options.writeConcern`. The final merged keys will be under `finalOptions.writeConcern`.
646-
// `fromOptions` will warn if `options` is using deprecated write concern options
647+
// This way, `fromOptions` will warn once if `options` is using deprecated write concern options
647648
const optionsWriteConcern = WriteConcern.fromOptions(options);
648649
if (optionsWriteConcern) {
649650
finalOptions.writeConcern = Object.assign(
@@ -790,7 +791,7 @@ function transformUrlOptions(_object) {
790791
}
791792

792793
// Any write concern options from the URL will be top-level, so we manually
793-
// move them options under `object.writeConcern`
794+
// move them options under `object.writeConcern` to avoid warnings later
794795
const wcKeys = ['w', 'wtimeout', 'j', 'fsync'];
795796
for (const key of wcKeys) {
796797
if (object[key] !== undefined) {

0 commit comments

Comments
 (0)