@@ -65,10 +65,7 @@ describe('Authentication', function () {
65
65
66
66
// restart server
67
67
configuration . manager . restart ( true ) . then ( function ( ) {
68
- var client = new MongoClient (
69
- new Server ( configuration . host , configuration . port , { auto_reconnect : true } ) ,
70
- { w : 1 }
71
- ) ;
68
+ var client = new MongoClient ( new Server ( configuration . host , configuration . port ) , { w : 1 } ) ;
72
69
client . connect ( function ( err , client ) {
73
70
test . equal ( null , err ) ;
74
71
var db = client . db ( configuration . db ) ;
@@ -77,10 +74,12 @@ describe('Authentication', function () {
77
74
test . equal ( null , err ) ;
78
75
client . close ( ) ;
79
76
80
- var client1 = new MongoClient (
81
- new Server ( configuration . host , configuration . port , { auto_reconnect : true } ) ,
82
- { w : 1 , user : 'admin' , password : 'admin' , authMechanism : 'SCRAM-SHA-1' }
83
- ) ;
77
+ var client1 = new MongoClient ( new Server ( configuration . host , configuration . port ) , {
78
+ w : 1 ,
79
+ user : 'admin' ,
80
+ password : 'admin' ,
81
+ authMechanism : 'SCRAM-SHA-1'
82
+ } ) ;
84
83
85
84
client1 . connect ( function ( err ) {
86
85
test . ok ( err ) ;
@@ -107,10 +106,7 @@ describe('Authentication', function () {
107
106
108
107
// restart server
109
108
configuration . manager . restart ( true ) . then ( function ( ) {
110
- var client = new MongoClient (
111
- new Server ( configuration . host , configuration . port , { auto_reconnect : true } ) ,
112
- { w : 1 }
113
- ) ;
109
+ var client = new MongoClient ( new Server ( configuration . host , configuration . port ) , { w : 1 } ) ;
114
110
client . connect ( function ( err , client ) {
115
111
test . equal ( null , err ) ;
116
112
var db = client . db ( configuration . db ) ;
@@ -143,7 +139,7 @@ describe('Authentication', function () {
143
139
test : function ( done ) {
144
140
var configuration = this . configuration ;
145
141
146
- const client = configuration . newClient ( configuration . writeConcernMax ( ) , { poolSize : 1 } ) ;
142
+ const client = configuration . newClient ( configuration . writeConcernMax ( ) , { maxPoolSize : 1 } ) ;
147
143
client . connect ( function ( err , client ) {
148
144
var db = client . db ( configuration . db ) ;
149
145
var collection = db . collection (
@@ -189,7 +185,7 @@ describe('Authentication', function () {
189
185
190
186
test : function ( done ) {
191
187
var configuration = this . configuration ;
192
- var client = configuration . newClient ( { w : 1 } , { poolSize : 1 } ) ;
188
+ var client = configuration . newClient ( { w : 1 } , { maxPoolSize : 1 } ) ;
193
189
194
190
// DOC_LINE var client = new MongoClient(new Server('localhost', 27017));
195
191
// DOC_START
@@ -245,7 +241,7 @@ describe('Authentication', function () {
245
241
246
242
// restart server
247
243
configuration . manager . restart ( true ) . then ( function ( ) {
248
- var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
244
+ var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
249
245
w : 1
250
246
} ) ;
251
247
client . connect ( function ( err , client ) {
@@ -257,7 +253,7 @@ describe('Authentication', function () {
257
253
test . equal ( null , err ) ;
258
254
client . close ( ) ;
259
255
260
- new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
256
+ new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
261
257
w : 1 ,
262
258
user : 'admin' ,
263
259
password : 'admin' ,
@@ -278,7 +274,7 @@ describe('Authentication', function () {
278
274
test . ok ( err != null ) ;
279
275
280
276
// // Login the user
281
- new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
277
+ new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
282
278
w : 1 ,
283
279
user : 'user' ,
284
280
password : 'user' ,
@@ -328,7 +324,7 @@ describe('Authentication', function () {
328
324
329
325
// restart server
330
326
configuration . manager . restart ( true ) . then ( function ( ) {
331
- var client = new MongoClient ( new Server ( 'localhost' , 27017 , { auto_reconnect : true } ) , {
327
+ var client = new MongoClient ( new Server ( 'localhost' , 27017 ) , {
332
328
w : 1
333
329
} ) ;
334
330
client . connect ( function ( err , client ) {
@@ -344,7 +340,7 @@ describe('Authentication', function () {
344
340
client . close ( ) ;
345
341
346
342
// Login the user
347
- new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
343
+ new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
348
344
w : 1 ,
349
345
user : 'admin' ,
350
346
password : 'admin' ,
@@ -403,7 +399,7 @@ describe('Authentication', function () {
403
399
404
400
// restart server
405
401
configuration . manager . restart ( true ) . then ( function ( ) {
406
- var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
402
+ var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
407
403
w : 1
408
404
} ) ;
409
405
@@ -456,7 +452,7 @@ describe('Authentication', function () {
456
452
457
453
// restart server
458
454
configuration . manager . restart ( true ) . then ( function ( ) {
459
- var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 , { auto_reconnect : true } ) , {
455
+ var client = new MongoClient ( new Server ( '127.0.0.1' , 27017 ) , {
460
456
w : 1
461
457
} ) ;
462
458
client . connect ( function ( err , client ) {
@@ -600,7 +596,7 @@ describe('Authentication', function () {
600
596
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
601
597
{
602
598
rs_name : 'rs' ,
603
- poolSize : 1
599
+ maxPoolSize : 1
604
600
}
605
601
) ;
606
602
@@ -618,7 +614,7 @@ describe('Authentication', function () {
618
614
new MongoClient (
619
615
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
620
616
rs_name : 'rs' ,
621
- poolSize : 1
617
+ maxPoolSize : 1
622
618
} ) ,
623
619
{ user : 'root' , password : 'root' , authSource : 'admin' }
624
620
) . connect ( function ( err , client ) {
@@ -674,7 +670,7 @@ describe('Authentication', function () {
674
670
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
675
671
{
676
672
rs_name : 'rs' ,
677
- poolSize : 1
673
+ maxPoolSize : 1
678
674
}
679
675
) ;
680
676
@@ -747,7 +743,7 @@ describe('Authentication', function () {
747
743
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
748
744
{
749
745
rs_name : 'rs' ,
750
- poolSize : 1
746
+ maxPoolSize : 1
751
747
}
752
748
) ;
753
749
@@ -819,7 +815,7 @@ describe('Authentication', function () {
819
815
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
820
816
{
821
817
rs_name : 'rs' ,
822
- poolSize : 1
818
+ maxPoolSize : 1
823
819
}
824
820
) ;
825
821
@@ -837,7 +833,7 @@ describe('Authentication', function () {
837
833
new MongoClient (
838
834
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
839
835
rs_name : 'rs' ,
840
- poolSize : 1
836
+ maxPoolSize : 1
841
837
} ) ,
842
838
{ w : 1 , user : 'admin' , password : 'admin' , authSource : 'admin' }
843
839
) . connect ( function ( err , client ) {
@@ -895,7 +891,7 @@ describe('Authentication', function () {
895
891
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
896
892
{
897
893
rs_name : 'rs' ,
898
- poolSize : 1
894
+ maxPoolSize : 1
899
895
}
900
896
) ;
901
897
@@ -912,7 +908,7 @@ describe('Authentication', function () {
912
908
new MongoClient (
913
909
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
914
910
rs_name : 'rs' ,
915
- poolSize : 1
911
+ maxPoolSize : 1
916
912
} ) ,
917
913
{ w : 1 , user : 'admin' , password : 'admin' , authSource : 'admin' }
918
914
) . connect ( function ( err , client ) {
@@ -969,7 +965,7 @@ describe('Authentication', function () {
969
965
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
970
966
{
971
967
rs_name : 'rs' ,
972
- poolSize : 1
968
+ maxPoolSize : 1
973
969
}
974
970
) ;
975
971
@@ -986,7 +982,7 @@ describe('Authentication', function () {
986
982
new MongoClient (
987
983
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
988
984
rs_name : 'rs' ,
989
- poolSize : 1
985
+ maxPoolSize : 1
990
986
} ) ,
991
987
{ w : 1 , user : 'admin' , password : 'admin' , authSource : 'admin' }
992
988
) . connect ( function ( err , client ) {
@@ -1107,7 +1103,7 @@ describe('Authentication', function () {
1107
1103
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1108
1104
{
1109
1105
rs_name : 'rs' ,
1110
- poolSize : 1
1106
+ maxPoolSize : 1
1111
1107
}
1112
1108
) ;
1113
1109
@@ -1123,7 +1119,7 @@ describe('Authentication', function () {
1123
1119
new MongoClient (
1124
1120
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1125
1121
rs_name : 'rs' ,
1126
- poolSize : 1
1122
+ maxPoolSize : 1
1127
1123
} ) ,
1128
1124
{ w : 1 , user : 'me' , password : 'secret' , authSource : 'admin' }
1129
1125
) . connect ( function ( err , client ) {
@@ -1137,7 +1133,7 @@ describe('Authentication', function () {
1137
1133
new MongoClient (
1138
1134
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1139
1135
rs_name : 'rs' ,
1140
- poolSize : 1
1136
+ maxPoolSize : 1
1141
1137
} ) ,
1142
1138
{ w : 1 , user : 'test' , password : 'test' , authSource : configuration . db }
1143
1139
) . connect ( function ( err , client ) {
@@ -1193,7 +1189,7 @@ describe('Authentication', function () {
1193
1189
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1194
1190
{
1195
1191
rs_name : 'rs' ,
1196
- poolSize : 1
1192
+ maxPoolSize : 1
1197
1193
}
1198
1194
) ;
1199
1195
@@ -1209,7 +1205,7 @@ describe('Authentication', function () {
1209
1205
new MongoClient (
1210
1206
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1211
1207
rs_name : 'rs' ,
1212
- poolSize : 1
1208
+ maxPoolSize : 1
1213
1209
} ) ,
1214
1210
{ w : 1 , user : 'me' , password : 'secret' , authSource : 'admin' }
1215
1211
) . connect ( function ( err , client ) {
@@ -1223,7 +1219,7 @@ describe('Authentication', function () {
1223
1219
new MongoClient (
1224
1220
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1225
1221
rs_name : 'rs' ,
1226
- poolSize : 1
1222
+ maxPoolSize : 1
1227
1223
} ) ,
1228
1224
{ w : 1 , user : 'test' , password : 'test' , authSource : configuration . db }
1229
1225
) . connect ( function ( err , client ) {
@@ -1267,7 +1263,7 @@ describe('Authentication', function () {
1267
1263
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1268
1264
{
1269
1265
rs_name : 'rs' ,
1270
- poolSize : 1
1266
+ maxPoolSize : 1
1271
1267
}
1272
1268
) ;
1273
1269
@@ -1285,7 +1281,7 @@ describe('Authentication', function () {
1285
1281
new MongoClient (
1286
1282
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1287
1283
rs_name : 'rs' ,
1288
- poolSize : 1
1284
+ maxPoolSize : 1
1289
1285
} ) ,
1290
1286
{ w : 1 , user : 'me' , password : 'secret' , authSource : 'admin' }
1291
1287
) . connect ( function ( err , client ) {
@@ -1377,7 +1373,7 @@ describe('Authentication', function () {
1377
1373
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1378
1374
{
1379
1375
rs_name : 'rs' ,
1380
- poolSize : 1
1376
+ maxPoolSize : 1
1381
1377
}
1382
1378
) ;
1383
1379
@@ -1394,7 +1390,7 @@ describe('Authentication', function () {
1394
1390
new MongoClient (
1395
1391
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1396
1392
rs_name : 'rs' ,
1397
- poolSize : 1
1393
+ maxPoolSize : 1
1398
1394
} ) ,
1399
1395
{ w : 1 , user : 'admin' , password : 'admin' , authSource : 'admin' }
1400
1396
) . connect ( function ( err , client ) {
@@ -1411,7 +1407,7 @@ describe('Authentication', function () {
1411
1407
new MongoClient (
1412
1408
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1413
1409
rs_name : 'rs' ,
1414
- poolSize : 1
1410
+ maxPoolSize : 1
1415
1411
} ) ,
1416
1412
{ w : 1 , user : 'test' , password : 'test' , authSource : configuration . db }
1417
1413
) . connect ( function ( err , client ) {
@@ -1474,7 +1470,7 @@ describe('Authentication', function () {
1474
1470
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1475
1471
{
1476
1472
rs_name : 'rs' ,
1477
- poolSize : 1
1473
+ maxPoolSize : 1
1478
1474
}
1479
1475
) ;
1480
1476
@@ -1546,7 +1542,7 @@ describe('Authentication', function () {
1546
1542
[ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] ,
1547
1543
{
1548
1544
rs_name : 'rs' ,
1549
- poolSize : 1
1545
+ maxPoolSize : 1
1550
1546
}
1551
1547
) ;
1552
1548
@@ -1561,7 +1557,7 @@ describe('Authentication', function () {
1561
1557
new MongoClient (
1562
1558
new ReplSet ( [ new Server ( 'localhost' , 31000 ) , new Server ( 'localhost' , 31001 ) ] , {
1563
1559
rs_name : 'rs' ,
1564
- poolSize : 1
1560
+ maxPoolSize : 1
1565
1561
} ) ,
1566
1562
{ w : 1 , user : 'admin' , password : 'admin' , authSource : 'admin' }
1567
1563
) . connect ( function ( err , client ) {
@@ -1677,7 +1673,7 @@ describe('Authentication', function () {
1677
1673
Mongos = configuration . require . Mongos ;
1678
1674
1679
1675
setUpSharded ( configuration , function ( err , manager ) {
1680
- var mongos = new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { poolSize : 1 } ) ;
1676
+ var mongos = new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { maxPoolSize : 1 } ) ;
1681
1677
1682
1678
var client = new MongoClient ( mongos , { w : 1 } ) ;
1683
1679
client . connect ( function ( err , client ) {
@@ -1689,7 +1685,7 @@ describe('Authentication', function () {
1689
1685
test . equal ( null , err ) ;
1690
1686
client . close ( ) ;
1691
1687
1692
- new MongoClient ( new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { poolSize : 1 } ) , {
1688
+ new MongoClient ( new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { maxPoolSize : 1 } ) , {
1693
1689
w : 1 ,
1694
1690
user : 'admin' ,
1695
1691
password : 'admin' ,
@@ -1741,7 +1737,7 @@ describe('Authentication', function () {
1741
1737
Mongos = configuration . require . Mongos ;
1742
1738
1743
1739
setUpSharded ( configuration , function ( err , manager ) {
1744
- var mongos = new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { poolSize : 1 } ) ;
1740
+ var mongos = new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { maxPoolSize : 1 } ) ;
1745
1741
1746
1742
var client = new MongoClient ( mongos , { w : 1 } ) ;
1747
1743
client . connect ( function ( err , client ) {
@@ -1753,7 +1749,7 @@ describe('Authentication', function () {
1753
1749
test . equal ( null , err ) ;
1754
1750
client . close ( ) ;
1755
1751
1756
- new MongoClient ( new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { poolSize : 1 } ) , {
1752
+ new MongoClient ( new Mongos ( [ new Server ( 'localhost' , 51000 ) ] , { maxPoolSize : 1 } ) , {
1757
1753
w : 1 ,
1758
1754
user : 'admin' ,
1759
1755
password : 'admin' ,
0 commit comments