@@ -54,10 +54,10 @@ func containsKey(doc bsonx.Doc, key ...string) bool {
54
54
}
55
55
56
56
func InsertExamples (t * testing.T , db * mongo.Database ) {
57
- _ , err := db .RunCommand (
57
+ err := db .RunCommand (
58
58
context .Background (),
59
59
bson.D {{"dropDatabase" , 1 }},
60
- )
60
+ ). Err ()
61
61
require .NoError (t , err )
62
62
63
63
coll := db .Collection ("inventory" )
@@ -145,10 +145,10 @@ func InsertExamples(t *testing.T, db *mongo.Database) {
145
145
}
146
146
147
147
func QueryToplevelFieldsExamples (t * testing.T , db * mongo.Database ) {
148
- _ , err := db .RunCommand (
148
+ err := db .RunCommand (
149
149
context .Background (),
150
150
bson.D {{"dropDatabase" , 1 }},
151
- )
151
+ ). Err ()
152
152
require .NoError (t , err )
153
153
154
154
coll := db .Collection ("inventory" )
@@ -315,10 +315,10 @@ func QueryToplevelFieldsExamples(t *testing.T, db *mongo.Database) {
315
315
}
316
316
317
317
func QueryEmbeddedDocumentsExamples (t * testing.T , db * mongo.Database ) {
318
- _ , err := db .RunCommand (
318
+ err := db .RunCommand (
319
319
context .Background (),
320
320
bson.D {{"dropDatabase" , 1 }},
321
- )
321
+ ). Err ()
322
322
require .NoError (t , err )
323
323
324
324
coll := db .Collection ("inventory" )
@@ -478,10 +478,10 @@ func QueryEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
478
478
}
479
479
480
480
func QueryArraysExamples (t * testing.T , db * mongo.Database ) {
481
- _ , err := db .RunCommand (
481
+ err := db .RunCommand (
482
482
context .Background (),
483
483
bson.D {{"dropDatabase" , 1 }},
484
- )
484
+ ). Err ()
485
485
require .NoError (t , err )
486
486
487
487
coll := db .Collection ("inventory" )
@@ -666,10 +666,10 @@ func QueryArraysExamples(t *testing.T, db *mongo.Database) {
666
666
}
667
667
668
668
func QueryArrayEmbeddedDocumentsExamples (t * testing.T , db * mongo.Database ) {
669
- _ , err := db .RunCommand (
669
+ err := db .RunCommand (
670
670
context .Background (),
671
671
bson.D {{"dropDatabase" , 1 }},
672
- )
672
+ ). Err ()
673
673
require .NoError (t , err )
674
674
675
675
coll := db .Collection ("inventory" )
@@ -897,10 +897,10 @@ func QueryArrayEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
897
897
}
898
898
899
899
func QueryNullMissingFieldsExamples (t * testing.T , db * mongo.Database ) {
900
- _ , err := db .RunCommand (
900
+ err := db .RunCommand (
901
901
context .Background (),
902
902
bson.D {{"dropDatabase" , 1 }},
903
- )
903
+ ). Err ()
904
904
require .NoError (t , err )
905
905
906
906
coll := db .Collection ("inventory" )
@@ -977,10 +977,10 @@ func QueryNullMissingFieldsExamples(t *testing.T, db *mongo.Database) {
977
977
}
978
978
979
979
func ProjectionExamples (t * testing.T , db * mongo.Database ) {
980
- _ , err := db .RunCommand (
980
+ err := db .RunCommand (
981
981
context .Background (),
982
982
bson.D {{"dropDatabase" , 1 }},
983
- )
983
+ ). Err ()
984
984
require .NoError (t , err )
985
985
986
986
coll := db .Collection ("inventory" )
@@ -1099,7 +1099,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1099
1099
{"item" , 1 },
1100
1100
{"status" , 1 },
1101
1101
}
1102
- require .NoError (t , err )
1103
1102
1104
1103
cursor , err := coll .Find (
1105
1104
context .Background (),
@@ -1137,7 +1136,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1137
1136
{"status" , 1 },
1138
1137
{"_id" , 0 },
1139
1138
}
1140
- require .NoError (t , err )
1141
1139
1142
1140
cursor , err := coll .Find (
1143
1141
context .Background (),
@@ -1174,7 +1172,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1174
1172
{"status" , 0 },
1175
1173
{"instock" , 0 },
1176
1174
}
1177
- require .NoError (t , err )
1178
1175
1179
1176
cursor , err := coll .Find (
1180
1177
context .Background (),
@@ -1212,7 +1209,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1212
1209
{"status" , 1 },
1213
1210
{"size.uom" , 1 },
1214
1211
}
1215
- require .NoError (t , err )
1216
1212
1217
1213
cursor , err := coll .Find (
1218
1214
context .Background (),
@@ -1253,7 +1249,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1253
1249
projection := bson.D {
1254
1250
{"size.uom" , 0 },
1255
1251
}
1256
- require .NoError (t , err )
1257
1252
1258
1253
cursor , err := coll .Find (
1259
1254
context .Background (),
@@ -1296,7 +1291,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1296
1291
{"status" , 1 },
1297
1292
{"instock.qty" , 1 },
1298
1293
}
1299
- require .NoError (t , err )
1300
1294
1301
1295
cursor , err := coll .Find (
1302
1296
context .Background (),
@@ -1350,7 +1344,6 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1350
1344
{"$slice" , - 1 },
1351
1345
}},
1352
1346
}
1353
- require .NoError (t , err )
1354
1347
1355
1348
cursor , err := coll .Find (
1356
1349
context .Background (),
@@ -1386,10 +1379,10 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
1386
1379
}
1387
1380
1388
1381
func UpdateExamples (t * testing.T , db * mongo.Database ) {
1389
- _ , err := db .RunCommand (
1382
+ err := db .RunCommand (
1390
1383
context .Background (),
1391
1384
bson.D {{"dropDatabase" , 1 }},
1392
- )
1385
+ ). Err ()
1393
1386
require .NoError (t , err )
1394
1387
1395
1388
coll := db .Collection ("inventory" )
@@ -1677,10 +1670,10 @@ func UpdateExamples(t *testing.T, db *mongo.Database) {
1677
1670
}
1678
1671
1679
1672
func DeleteExamples (t * testing.T , db * mongo.Database ) {
1680
- _ , err := db .RunCommand (
1673
+ err := db .RunCommand (
1681
1674
context .Background (),
1682
1675
bson.D {{"dropDatabase" , 1 }},
1683
- )
1676
+ ). Err ()
1684
1677
require .NoError (t , err )
1685
1678
1686
1679
coll := db .Collection ("inventory" )
0 commit comments