@@ -302,6 +302,7 @@ function connect(mongoClient, url, options, callback) {
302
302
delete _finalOptions . db_options . auth ;
303
303
}
304
304
305
+ // `journal` should be translated to `j` for the driver
305
306
if ( _finalOptions . journal != null ) {
306
307
if ( _finalOptions . writeConcern == null ) _finalOptions . writeConcern = { } ;
307
308
_finalOptions . writeConcern . j = _finalOptions . journal ;
@@ -643,7 +644,7 @@ function createUnifiedOptions(finalOptions, options) {
643
644
644
645
// Handle write concern keys separately, since `options` may have the keys at the top level or
645
646
// 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
647
648
const optionsWriteConcern = WriteConcern . fromOptions ( options ) ;
648
649
if ( optionsWriteConcern ) {
649
650
finalOptions . writeConcern = Object . assign (
@@ -790,7 +791,7 @@ function transformUrlOptions(_object) {
790
791
}
791
792
792
793
// 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
794
795
const wcKeys = [ 'w' , 'wtimeout' , 'j' , 'fsync' ] ;
795
796
for ( const key of wcKeys ) {
796
797
if ( object [ key ] !== undefined ) {
0 commit comments