@@ -72,6 +72,7 @@ const legalOptionNames = [
72
72
'wtimeout' ,
73
73
'fsync' ,
74
74
'j' ,
75
+ 'writeConcern' ,
75
76
'readPreference' ,
76
77
'readPreferenceTags' ,
77
78
'native_parser' ,
@@ -105,9 +106,10 @@ const legalOptionNames = [
105
106
* @param {(Server|ReplSet|Mongos) } topology The server topology for the database.
106
107
* @param {object } [options] Optional settings.
107
108
* @param {string } [options.authSource] If the database authentication is dependent on another databaseName.
108
- * @param {(number|string) } [options.w] The write concern.
109
- * @param {number } [options.wtimeout] The write concern timeout.
110
- * @param {boolean } [options.j=false] Specify a journal write concern.
109
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
110
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
111
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
112
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
111
113
* @param {boolean } [options.forceServerObjectId=false] Force server to assign _id values instead of driver.
112
114
* @param {boolean } [options.serializeFunctions=false] Serialize functions on any object.
113
115
* @param {Boolean } [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
@@ -399,9 +401,10 @@ const collectionKeys = [
399
401
* @method
400
402
* @param {string } name the collection name we wish to access.
401
403
* @param {object } [options] Optional settings.
402
- * @param {(number|string) } [options.w] The write concern.
403
- * @param {number } [options.wtimeout] The write concern timeout.
404
- * @param {boolean } [options.j=false] Specify a journal write concern.
404
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
405
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
406
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
407
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
405
408
* @param {boolean } [options.raw=false] Return document results as raw BSON buffers.
406
409
* @param {object } [options.pkFactory] A primary key factory object for generation of custom _id keys.
407
410
* @param {(ReadPreference|string) } [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
@@ -493,9 +496,10 @@ Db.prototype.collection = function(name, options, callback) {
493
496
* @method
494
497
* @param {string } name the collection name we wish to access.
495
498
* @param {object } [options] Optional settings.
496
- * @param {(number|string) } [options.w] The write concern.
497
- * @param {number } [options.wtimeout] The write concern timeout.
498
- * @param {boolean } [options.j=false] Specify a journal write concern.
499
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
500
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
501
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
502
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
499
503
* @param {boolean } [options.raw=false] Return document results as raw BSON buffers.
500
504
* @param {object } [options.pkFactory] A primary key factory object for generation of custom _id keys.
501
505
* @param {(ReadPreference|string) } [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
@@ -521,7 +525,7 @@ Db.prototype.collection = function(name, options, callback) {
521
525
Db . prototype . createCollection = deprecateOptions (
522
526
{
523
527
name : 'Db.createCollection' ,
524
- deprecatedOptions : [ 'autoIndexId' , 'strict' ] ,
528
+ deprecatedOptions : [ 'autoIndexId' , 'strict' , 'w' , 'wtimeout' , 'j' ] ,
525
529
optionsIndex : 1
526
530
} ,
527
531
function ( name , options , callback ) {
@@ -651,10 +655,10 @@ Db.prototype.renameCollection = function(fromCollection, toCollection, options,
651
655
* @method
652
656
* @param {string } name Name of collection to drop
653
657
* @param {Object } [options] Optional settings
654
- * @param {WriteConcern } [options.writeConcern] A full WriteConcern object
655
- * @param {( number|string) } [options.w] The write concern
656
- * @param {number } [options.wtimeout] The write concern timeout
657
- * @param {boolean } [options.j] The journal write concern
658
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
659
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
660
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
661
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
658
662
* @param {ClientSession } [options.session] optional session to use for this operation
659
663
* @param {Db~resultCallback } [callback] The results callback
660
664
* @return {Promise } returns Promise if no callback passed
@@ -734,9 +738,10 @@ Db.prototype.executeDbAdminCommand = function(selector, options, callback) {
734
738
* @param {string } name Name of the collection to create the index on.
735
739
* @param {(string|object) } fieldOrSpec Defines the index.
736
740
* @param {object } [options] Optional settings.
737
- * @param {(number|string) } [options.w] The write concern.
738
- * @param {number } [options.wtimeout] The write concern timeout.
739
- * @param {boolean } [options.j=false] Specify a journal write concern.
741
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
742
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
743
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
744
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
740
745
* @param {boolean } [options.unique=false] Creates an unique index.
741
746
* @param {boolean } [options.sparse=false] Creates a sparse index.
742
747
* @param {boolean } [options.background=false] Creates the index in the background, yielding whenever possible.
@@ -768,9 +773,10 @@ Db.prototype.createIndex = function(name, fieldOrSpec, options, callback) {
768
773
* @param {string } name The index name
769
774
* @param {(string|object) } fieldOrSpec Defines the index.
770
775
* @param {object } [options] Optional settings.
771
- * @param {(number|string) } [options.w] The write concern.
772
- * @param {number } [options.wtimeout] The write concern timeout.
773
- * @param {boolean } [options.j=false] Specify a journal write concern.
776
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
777
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
778
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
779
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
774
780
* @param {boolean } [options.unique=false] Creates an unique index.
775
781
* @param {boolean } [options.sparse=false] Creates a sparse index.
776
782
* @param {boolean } [options.background=false] Creates the index in the background, yielding whenever possible.
@@ -808,9 +814,10 @@ Db.prototype.addChild = function(db) {
808
814
* @param {string } username The username.
809
815
* @param {string } password The password.
810
816
* @param {object } [options] Optional settings.
811
- * @param {(number|string) } [options.w] The write concern.
812
- * @param {number } [options.wtimeout] The write concern timeout.
813
- * @param {boolean } [options.j=false] Specify a journal write concern.
817
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
818
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
819
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
820
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
814
821
* @param {object } [options.customData] Custom data associated with the user (only Mongodb 2.6 or higher)
815
822
* @param {object[] } [options.roles] Roles associated with the created user (only Mongodb 2.6 or higher)
816
823
* @param {ClientSession } [options.session] optional session to use for this operation
@@ -837,9 +844,10 @@ Db.prototype.addUser = function(username, password, options, callback) {
837
844
* @method
838
845
* @param {string } username The username.
839
846
* @param {object } [options] Optional settings.
840
- * @param {(number|string) } [options.w] The write concern.
841
- * @param {number } [options.wtimeout] The write concern timeout.
842
- * @param {boolean } [options.j=false] Specify a journal write concern.
847
+ * @param {(number|string) } [options.w] **Deprecated** The write concern. Use writeConcern instead.
848
+ * @param {number } [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
849
+ * @param {boolean } [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
850
+ * @param {object|WriteConcern } [options.writeConcern] Specify write concern settings.
843
851
* @param {ClientSession } [options.session] optional session to use for this operation
844
852
* @param {Db~resultCallback } [callback] The command result callback
845
853
* @return {Promise } returns Promise if no callback passed
0 commit comments