@@ -98,7 +98,7 @@ func InsertExamples(t *testing.T, db *mongo.Database) {
9898
9999 result , err := coll .InsertMany (
100100 context .TODO (),
101- []interface {} {
101+ []any {
102102 bson.D {
103103 {"item" , "journal" },
104104 {"qty" , int32 (25 )},
@@ -149,7 +149,7 @@ func QueryToplevelFieldsExamples(t *testing.T, db *mongo.Database) {
149149 {
150150 // Start Example 6
151151
152- docs := []interface {} {
152+ docs := []any {
153153 bson.D {
154154 {"item" , "journal" },
155155 {"qty" , 25 },
@@ -318,7 +318,7 @@ func QueryEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
318318 {
319319 // Start Example 14
320320
321- docs := []interface {} {
321+ docs := []any {
322322 bson.D {
323323 {"item" , "journal" },
324324 {"qty" , 25 },
@@ -480,7 +480,7 @@ func QueryArraysExamples(t *testing.T, db *mongo.Database) {
480480 {
481481 // Start Example 20
482482
483- docs := []interface {} {
483+ docs := []any {
484484 bson.D {
485485 {"item" , "journal" },
486486 {"qty" , 25 },
@@ -667,7 +667,7 @@ func QueryArrayEmbeddedDocumentsExamples(t *testing.T, db *mongo.Database) {
667667 {
668668 // Start Example 29
669669
670- docs := []interface {} {
670+ docs := []any {
671671 bson.D {
672672 {"item" , "journal" },
673673 {"instock" , bson.A {
@@ -897,7 +897,7 @@ func QueryNullMissingFieldsExamples(t *testing.T, db *mongo.Database) {
897897 {
898898 // Start Example 38
899899
900- docs := []interface {} {
900+ docs := []any {
901901 bson.D {
902902 {"_id" , 1 },
903903 {"item" , nil },
@@ -976,7 +976,7 @@ func ProjectionExamples(t *testing.T, db *mongo.Database) {
976976 {
977977 // Start Example 42
978978
979- docs := []interface {} {
979+ docs := []any {
980980 bson.D {
981981 {"item" , "journal" },
982982 {"status" , "A" },
@@ -1361,7 +1361,7 @@ func UpdateExamples(t *testing.T, db *mongo.Database) {
13611361 {
13621362 // Start Example 51
13631363
1364- docs := []interface {} {
1364+ docs := []any {
13651365 bson.D {
13661366 {"item" , "canvas" },
13671367 {"qty" , 100 },
@@ -1641,7 +1641,7 @@ func DeleteExamples(t *testing.T, db *mongo.Database) {
16411641
16421642 {
16431643 // Start Example 55
1644- docs := []interface {} {
1644+ docs := []any {
16451645 bson.D {
16461646 {"item" , "journal" },
16471647 {"qty" , 25 },
@@ -1985,7 +1985,7 @@ func WithTransactionExample(ctx context.Context) error {
19851985 barColl := client .Database ("mydb1" ).Collection ("bar" , wcMajorityCollectionOpts )
19861986
19871987 // 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 ) {
19891989 // Important: You must pass sesctx as the Context parameter to the operations for them to be executed in the
19901990 // transaction.
19911991 if _ , err := fooColl .InsertOne (sesctx , bson.D {{"abc" , 1 }}); err != nil {
@@ -2145,7 +2145,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
21452145 date20180205 := parseDate (t , "2018-02-05T06:03:00.000Z" )
21462146 date20180111 := parseDate (t , "2018-01-11T07:15:00.000Z" )
21472147
2148- sales := []interface {} {
2148+ sales := []any {
21492149 bson.D {
21502150 {"date" , date20180208 },
21512151 {"items" , bson.A {
@@ -2242,7 +2242,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
22422242 }},
22432243 },
22442244 }
2245- airlines := []interface {} {
2245+ airlines := []any {
22462246 bson.D {
22472247 {"airline" , 17 },
22482248 {"name" , "Air Canada" },
@@ -2314,7 +2314,7 @@ func AggregationExamples(t *testing.T, db *mongo.Database) {
23142314 {"base" , "CYS" },
23152315 },
23162316 }
2317- airAlliances := []interface {} {
2317+ airAlliances := []any {
23182318 bson.D {
23192319 {"name" , "Star Alliance" },
23202320 {"airlines" , bson.A {
@@ -2670,7 +2670,7 @@ func IndexExamples(t *testing.T, db *mongo.Database) {
26702670 err = restaurantsColl .Drop (ctx )
26712671 assert .NoError (t , err )
26722672
2673- records := []interface {} {
2673+ records := []any {
26742674 bson.D {
26752675 {"student" , "Marty McFly" },
26762676 {"classYear" , 1986 },
@@ -2691,7 +2691,7 @@ func IndexExamples(t *testing.T, db *mongo.Database) {
26912691 {"score" , 99.9 },
26922692 },
26932693 }
2694- restaurants := []interface {} {
2694+ restaurants := []any {
26952695 bson.D {
26962696 {"name" , "Chez Panisse" },
26972697 {"cuisine" , "American/French" },
@@ -2884,7 +2884,7 @@ func StableAPIStrictCountExample(t *testing.T) {
28842884 // Start Versioned API Example 5
28852885
28862886 coll := client .Database ("db" ).Collection ("sales" )
2887- docs := []interface {} {
2887+ docs := []any {
28882888 bson.D {{"_id" , 1 }, {"item" , "abc" }, {"price" , 10 }, {"quantity" , 2 }, {"date" , "2021-01-01T08:00:00Z" }},
28892889 bson.D {{"_id" , 2 }, {"item" , "jkl" }, {"price" , 20 }, {"quantity" , 1 }, {"date" , "2021-02-03T09:00:00Z" }},
28902890 bson.D {{"_id" , 3 }, {"item" , "xyz" }, {"price" , 5 }, {"quantity" , 5 }, {"date" , "2021-02-03T09:05:00Z" }},
@@ -2938,7 +2938,7 @@ func StableAPIExamples() {
29382938
29392939func insertSnapshotQueryTestData (mt * mtest.T ) {
29402940 catColl := mt .CreateCollection (mtest.Collection {Name : "cats" }, true )
2941- _ , err := catColl .InsertMany (context .Background (), []interface {} {
2941+ _ , err := catColl .InsertMany (context .Background (), []any {
29422942 bson.D {
29432943 {"adoptable" , false },
29442944 {"name" , "Miyagi" },
@@ -2955,7 +2955,7 @@ func insertSnapshotQueryTestData(mt *mtest.T) {
29552955 assert .NoError (mt , err )
29562956
29572957 dogColl := mt .CreateCollection (mtest.Collection {Name : "dogs" }, true )
2958- _ , err = dogColl .InsertMany (context .Background (), []interface {} {
2958+ _ , err = dogColl .InsertMany (context .Background (), []any {
29592959 bson.D {
29602960 {"adoptable" , true },
29612961 {"name" , "Cormac" },
@@ -2972,7 +2972,7 @@ func insertSnapshotQueryTestData(mt *mtest.T) {
29722972 assert .NoError (mt , err )
29732973
29742974 salesColl := mt .CreateCollection (mtest.Collection {Name : "sales" }, true )
2975- _ , err = salesColl .InsertMany (context .Background (), []interface {} {
2975+ _ , err = salesColl .InsertMany (context .Background (), []any {
29762976 bson.D {
29772977 {"shoeType" , "hiking boot" },
29782978 {"price" , 30.0 },
0 commit comments