@@ -98,7 +98,7 @@ func InsertExamples(t *testing.T, db *mongo.Database) {
98
98
99
99
result , err := coll .InsertMany (
100
100
context .TODO (),
101
- []interface {} {
101
+ []any {
102
102
bson.D {
103
103
{"item" , "journal" },
104
104
{"qty" , int32 (25 )},
@@ -149,7 +149,7 @@ func QueryToplevelFieldsExamples(t *testing.T, db *mongo.Database) {
149
149
{
150
150
// Start Example 6
151
151
152
- docs := []interface {} {
152
+ docs := []any {
153
153
bson.D {
154
154
{"item" , "journal" },
155
155
{"qty" , 25 },
@@ -318,7 +318,7 @@ func QueryEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
318
318
{
319
319
// Start Example 14
320
320
321
- docs := []interface {} {
321
+ docs := []any {
322
322
bson.D {
323
323
{"item" , "journal" },
324
324
{"qty" , 25 },
@@ -480,7 +480,7 @@ func QueryArraysExamples(t *testing.T, db *mongo.Database) {
480
480
{
481
481
// Start Example 20
482
482
483
- docs := []interface {} {
483
+ docs := []any {
484
484
bson.D {
485
485
{"item" , "journal" },
486
486
{"qty" , 25 },
@@ -667,7 +667,7 @@ func QueryArrayEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
667
667
{
668
668
// Start Example 29
669
669
670
- docs := []interface {} {
670
+ docs := []any {
671
671
bson.D {
672
672
{"item" , "journal" },
673
673
{"instock" , bson.A {
@@ -897,7 +897,7 @@ func QueryNullMissingFieldsExamples(t *testing.T, db *mongo.Database) {
897
897
{
898
898
// Start Example 38
899
899
900
- docs := []interface {} {
900
+ docs := []any {
901
901
bson.D {
902
902
{"_id" , 1 },
903
903
{"item" , nil },
@@ -976,7 +976,7 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
976
976
{
977
977
// Start Example 42
978
978
979
- docs := []interface {} {
979
+ docs := []any {
980
980
bson.D {
981
981
{"item" , "journal" },
982
982
{"status" , "A" },
@@ -1361,7 +1361,7 @@ func UpdateExamples(t *testing.T, db *mongo.Database) {
1361
1361
{
1362
1362
// Start Example 51
1363
1363
1364
- docs := []interface {} {
1364
+ docs := []any {
1365
1365
bson.D {
1366
1366
{"item" , "canvas" },
1367
1367
{"qty" , 100 },
@@ -1641,7 +1641,7 @@ func DeleteExamples(t *testing.T, db *mongo.Database) {
1641
1641
1642
1642
{
1643
1643
// Start Example 55
1644
- docs := []interface {} {
1644
+ docs := []any {
1645
1645
bson.D {
1646
1646
{"item" , "journal" },
1647
1647
{"qty" , 25 },
@@ -1985,7 +1985,7 @@ func WithTransactionExample(ctx context.Context) error {
1985
1985
barColl := client .Database ("mydb1" ).Collection ("bar" , wcMajorityCollectionOpts )
1986
1986
1987
1987
// Step 1: Define the callback that specifies the sequence of operations to perform inside the transaction.
1988
- callback := func (sesctx context.Context ) (interface {} , error ) {
1988
+ callback := func (sesctx context.Context ) (any , error ) {
1989
1989
// Important: You must pass sesctx as the Context parameter to the operations for them to be executed in the
1990
1990
// transaction.
1991
1991
if _ , err := fooColl .InsertOne (sesctx , bson.D {{"abc" , 1 }}); err != nil {
@@ -2145,7 +2145,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
2145
2145
date20180205 := parseDate (t , "2018-02-05T06:03:00.000Z" )
2146
2146
date20180111 := parseDate (t , "2018-01-11T07:15:00.000Z" )
2147
2147
2148
- sales := []interface {} {
2148
+ sales := []any {
2149
2149
bson.D {
2150
2150
{"date" , date20180208 },
2151
2151
{"items" , bson.A {
@@ -2242,7 +2242,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
2242
2242
}},
2243
2243
},
2244
2244
}
2245
- airlines := []interface {} {
2245
+ airlines := []any {
2246
2246
bson.D {
2247
2247
{"airline" , 17 },
2248
2248
{"name" , "Air Canada" },
@@ -2314,7 +2314,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
2314
2314
{"base" , "CYS" },
2315
2315
},
2316
2316
}
2317
- airAlliances := []interface {} {
2317
+ airAlliances := []any {
2318
2318
bson.D {
2319
2319
{"name" , "Star Alliance" },
2320
2320
{"airlines" , bson.A {
@@ -2670,7 +2670,7 @@ func IndexExamples(t *testing.T, db *mongo.Database) {
2670
2670
err = restaurantsColl .Drop (ctx )
2671
2671
assert .NoError (t , err )
2672
2672
2673
- records := []interface {} {
2673
+ records := []any {
2674
2674
bson.D {
2675
2675
{"student" , "Marty McFly" },
2676
2676
{"classYear" , 1986 },
@@ -2691,7 +2691,7 @@ func IndexExamples(t *testing.T, db *mongo.Database) {
2691
2691
{"score" , 99.9 },
2692
2692
},
2693
2693
}
2694
- restaurants := []interface {} {
2694
+ restaurants := []any {
2695
2695
bson.D {
2696
2696
{"name" , "Chez Panisse" },
2697
2697
{"cuisine" , "American/French" },
@@ -2884,7 +2884,7 @@ func StableAPIStrictCountExample(t *testing.T) {
2884
2884
// Start Versioned API Example 5
2885
2885
2886
2886
coll := client .Database ("db" ).Collection ("sales" )
2887
- docs := []interface {} {
2887
+ docs := []any {
2888
2888
bson.D {{"_id" , 1 }, {"item" , "abc" }, {"price" , 10 }, {"quantity" , 2 }, {"date" , "2021-01-01T08:00:00Z" }},
2889
2889
bson.D {{"_id" , 2 }, {"item" , "jkl" }, {"price" , 20 }, {"quantity" , 1 }, {"date" , "2021-02-03T09:00:00Z" }},
2890
2890
bson.D {{"_id" , 3 }, {"item" , "xyz" }, {"price" , 5 }, {"quantity" , 5 }, {"date" , "2021-02-03T09:05:00Z" }},
@@ -2938,7 +2938,7 @@ func StableAPIExamples() {
2938
2938
2939
2939
func insertSnapshotQueryTestData (mt * mtest.T ) {
2940
2940
catColl := mt .CreateCollection (mtest.Collection {Name : "cats" }, true )
2941
- _ , err := catColl .InsertMany (context .Background (), []interface {} {
2941
+ _ , err := catColl .InsertMany (context .Background (), []any {
2942
2942
bson.D {
2943
2943
{"adoptable" , false },
2944
2944
{"name" , "Miyagi" },
@@ -2955,7 +2955,7 @@ func insertSnapshotQueryTestData(mt *mtest.T) {
2955
2955
assert .NoError (mt , err )
2956
2956
2957
2957
dogColl := mt .CreateCollection (mtest.Collection {Name : "dogs" }, true )
2958
- _ , err = dogColl .InsertMany (context .Background (), []interface {} {
2958
+ _ , err = dogColl .InsertMany (context .Background (), []any {
2959
2959
bson.D {
2960
2960
{"adoptable" , true },
2961
2961
{"name" , "Cormac" },
@@ -2972,7 +2972,7 @@ func insertSnapshotQueryTestData(mt *mtest.T) {
2972
2972
assert .NoError (mt , err )
2973
2973
2974
2974
salesColl := mt .CreateCollection (mtest.Collection {Name : "sales" }, true )
2975
- _ , err = salesColl .InsertMany (context .Background (), []interface {} {
2975
+ _ , err = salesColl .InsertMany (context .Background (), []any {
2976
2976
bson.D {
2977
2977
{"shoeType" , "hiking boot" },
2978
2978
{"price" , 30.0 },
0 commit comments