@@ -1199,8 +1199,10 @@ export const OPTIONS = {
1199
1199
target : 'writeConcern' ,
1200
1200
transform ( { name, options, values : [ value ] } ) : WriteConcern {
1201
1201
const wc = WriteConcern . fromOptions ( {
1202
- ...options . writeConcern ,
1203
- fsync : getBoolean ( name , value )
1202
+ writeConcern : {
1203
+ ...options . writeConcern ,
1204
+ fsync : getBoolean ( name , value )
1205
+ }
1204
1206
} ) ;
1205
1207
if ( ! wc ) throw new TypeError ( `Unable to make a writeConcern from fsync=${ value } ` ) ;
1206
1208
return wc ;
@@ -1216,10 +1218,11 @@ export const OPTIONS = {
1216
1218
j : {
1217
1219
target : 'writeConcern' ,
1218
1220
transform ( { name, options, values : [ value ] } ) : WriteConcern {
1219
- console . warn ( 'j is deprecated' ) ;
1220
1221
const wc = WriteConcern . fromOptions ( {
1221
- ...options . writeConcern ,
1222
- journal : getBoolean ( name , value )
1222
+ writeConcern : {
1223
+ ...options . writeConcern ,
1224
+ journal : getBoolean ( name , value )
1225
+ }
1223
1226
} ) ;
1224
1227
if ( ! wc ) throw new TypeError ( `Unable to make a writeConcern from journal=${ value } ` ) ;
1225
1228
return wc ;
@@ -1229,8 +1232,10 @@ export const OPTIONS = {
1229
1232
target : 'writeConcern' ,
1230
1233
transform ( { name, options, values : [ value ] } ) : WriteConcern {
1231
1234
const wc = WriteConcern . fromOptions ( {
1232
- ...options . writeConcern ,
1233
- journal : getBoolean ( name , value )
1235
+ writeConcern : {
1236
+ ...options . writeConcern ,
1237
+ journal : getBoolean ( name , value )
1238
+ }
1234
1239
} ) ;
1235
1240
if ( ! wc ) throw new TypeError ( `Unable to make a writeConcern from journal=${ value } ` ) ;
1236
1241
return wc ;
@@ -1516,7 +1521,7 @@ export const OPTIONS = {
1516
1521
w : {
1517
1522
target : 'writeConcern' ,
1518
1523
transform ( { values : [ value ] , options } ) {
1519
- return WriteConcern . fromOptions ( { ...options . writeConcern , w : value as W } ) ;
1524
+ return WriteConcern . fromOptions ( { writeConcern : { ...options . writeConcern , w : value as W } } ) ;
1520
1525
}
1521
1526
} ,
1522
1527
waitQueueTimeoutMS : {
@@ -1528,8 +1533,10 @@ export const OPTIONS = {
1528
1533
transform ( { values : [ value ] , options } ) {
1529
1534
if ( isRecord ( value ) || value instanceof WriteConcern ) {
1530
1535
return WriteConcern . fromOptions ( {
1531
- ...options . writeConcern ,
1532
- ...value
1536
+ writeConcern : {
1537
+ ...options . writeConcern ,
1538
+ ...value
1539
+ }
1533
1540
} ) ;
1534
1541
}
1535
1542
@@ -1540,8 +1547,10 @@ export const OPTIONS = {
1540
1547
target : 'writeConcern' ,
1541
1548
transform ( { values : [ value ] , options } ) {
1542
1549
const wc = WriteConcern . fromOptions ( {
1543
- ...options . writeConcern ,
1544
- wtimeout : getUint ( 'wtimeout' , value )
1550
+ writeConcern : {
1551
+ ...options . writeConcern ,
1552
+ wtimeout : getUint ( 'wtimeout' , value )
1553
+ }
1545
1554
} ) ;
1546
1555
if ( wc ) return wc ;
1547
1556
throw new MongoParseError ( `Cannot make WriteConcern from wtimeout` ) ;
@@ -1551,8 +1560,10 @@ export const OPTIONS = {
1551
1560
target : 'writeConcern' ,
1552
1561
transform ( { values : [ value ] , options } ) {
1553
1562
const wc = WriteConcern . fromOptions ( {
1554
- ...options . writeConcern ,
1555
- wtimeoutMS : getUint ( 'wtimeoutMS' , value )
1563
+ writeConcern : {
1564
+ ...options . writeConcern ,
1565
+ wtimeoutMS : getUint ( 'wtimeoutMS' , value )
1566
+ }
1556
1567
} ) ;
1557
1568
if ( wc ) return wc ;
1558
1569
throw new MongoParseError ( `Cannot make WriteConcern from wtimeout` ) ;
0 commit comments