@@ -76,7 +76,7 @@ func executeAggregate(ctx context.Context, operation *operation) (*operationResu
76
76
case "let" :
77
77
opts .SetLet (val .Document ())
78
78
case "rawData" :
79
- opts .SetRawBucketsData (val .Boolean ())
79
+ opts .SetRawData (val .Boolean ())
80
80
default :
81
81
return nil , fmt .Errorf ("unrecognized aggregate option %q" , key )
82
82
}
@@ -128,7 +128,7 @@ func executeBulkWrite(ctx context.Context, operation *operation) (*operationResu
128
128
case "let" :
129
129
opts .SetLet (val .Document ())
130
130
case "rawData" :
131
- opts .SetRawBucketsData (val .Boolean ())
131
+ opts .SetRawData (val .Boolean ())
132
132
default :
133
133
return nil , fmt .Errorf ("unrecognized bulkWrite option %q" , key )
134
134
}
@@ -207,7 +207,7 @@ func executeCountDocuments(ctx context.Context, operation *operation) (*operatio
207
207
case "skip" :
208
208
opts .SetSkip (int64 (val .Int32 ()))
209
209
case "rawData" :
210
- opts .SetRawBucketsData (val .Boolean ())
210
+ opts .SetRawData (val .Boolean ())
211
211
default :
212
212
return nil , fmt .Errorf ("unrecognized countDocuments option %q" , key )
213
213
}
@@ -231,6 +231,7 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
231
231
232
232
var keys bson.Raw
233
233
indexOpts := options .Index ()
234
+ opts := options .CreateIndexes ()
234
235
235
236
elems , err := operation .Arguments .Elements ()
236
237
if err != nil {
@@ -285,6 +286,8 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
285
286
indexOpts .SetWeights (val .Document ())
286
287
case "wildcardProjection" :
287
288
indexOpts .SetWildcardProjection (val .Document ())
289
+ case "rawData" :
290
+ opts .SetRawData (val .Boolean ())
288
291
default :
289
292
return nil , fmt .Errorf ("unrecognized createIndex option %q" , key )
290
293
}
@@ -297,7 +300,8 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
297
300
Keys : keys ,
298
301
Options : indexOpts ,
299
302
}
300
- name , err := coll .Indexes ().CreateOne (ctx , model )
303
+
304
+ name , err := coll .Indexes ().CreateOne (ctx , model , opts )
301
305
return newValueResult (bson .TypeString , bsoncore .AppendString (nil , name ), err ), nil
302
306
}
303
307
@@ -440,7 +444,7 @@ func executeDeleteOne(ctx context.Context, operation *operation) (*operationResu
440
444
case "let" :
441
445
opts .SetLet (val .Document ())
442
446
case "rawData" :
443
- opts .SetRawBucketsData (val .Boolean ())
447
+ opts .SetRawData (val .Boolean ())
444
448
default :
445
449
return nil , fmt .Errorf ("unrecognized deleteOne option %q" , key )
446
450
}
@@ -496,7 +500,7 @@ func executeDeleteMany(ctx context.Context, operation *operation) (*operationRes
496
500
case "let" :
497
501
opts .SetLet (val .Document ())
498
502
case "rawData" :
499
- opts .SetRawBucketsData (val .Boolean ())
503
+ opts .SetRawData (val .Boolean ())
500
504
default :
501
505
return nil , fmt .Errorf ("unrecognized deleteMany option %q" , key )
502
506
}
@@ -556,7 +560,7 @@ func executeDistinct(ctx context.Context, operation *operation) (*operationResul
556
560
// this error.
557
561
return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
558
562
case "rawData" :
559
- opts .SetRawBucketsData (val .Boolean ())
563
+ opts .SetRawData (val .Boolean ())
560
564
default :
561
565
return nil , fmt .Errorf ("unrecognized distinct option %q" , key )
562
566
}
@@ -605,6 +609,8 @@ func executeDropIndex(ctx context.Context, operation *operation) (*operationResu
605
609
// ensured an analogue exists, extend "skippedTestDescriptions" to avoid
606
610
// this error.
607
611
return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
612
+ case "rawData" :
613
+ dropIndexOpts .SetRawData (val .Boolean ())
608
614
default :
609
615
return nil , fmt .Errorf ("unrecognized dropIndex option %q" , key )
610
616
}
@@ -703,7 +709,7 @@ func executeEstimatedDocumentCount(ctx context.Context, operation *operation) (*
703
709
// this error.
704
710
return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
705
711
case "rawData" :
706
- opts .SetRawBucketsData (val .Boolean ())
712
+ opts .SetRawData (val .Boolean ())
707
713
default :
708
714
return nil , fmt .Errorf ("unrecognized estimatedDocumentCount option %q" , key )
709
715
}
@@ -857,7 +863,7 @@ func executeFindOneAndDelete(ctx context.Context, operation *operation) (*operat
857
863
case "let" :
858
864
opts .SetLet (val .Document ())
859
865
case "rawData" :
860
- opts .SetRawBucketsData (val .Boolean ())
866
+ opts .SetRawData (val .Boolean ())
861
867
default :
862
868
return nil , fmt .Errorf ("unrecognized findOneAndDelete option %q" , key )
863
869
}
@@ -941,7 +947,7 @@ func executeFindOneAndReplace(ctx context.Context, operation *operation) (*opera
941
947
case "upsert" :
942
948
opts .SetUpsert (val .Boolean ())
943
949
case "rawData" :
944
- opts .SetRawBucketsData (val .Boolean ())
950
+ opts .SetRawData (val .Boolean ())
945
951
default :
946
952
return nil , fmt .Errorf ("unrecognized findOneAndReplace option %q" , key )
947
953
}
@@ -1035,7 +1041,7 @@ func executeFindOneAndUpdate(ctx context.Context, operation *operation) (*operat
1035
1041
case "upsert" :
1036
1042
opts .SetUpsert (val .Boolean ())
1037
1043
case "rawData" :
1038
- opts .SetRawBucketsData (val .Boolean ())
1044
+ opts .SetRawData (val .Boolean ())
1039
1045
default :
1040
1046
return nil , fmt .Errorf ("unrecognized findOneAndUpdate option %q" , key )
1041
1047
}
@@ -1083,7 +1089,7 @@ func executeInsertMany(ctx context.Context, operation *operation) (*operationRes
1083
1089
case "ordered" :
1084
1090
opts .SetOrdered (val .Boolean ())
1085
1091
case "rawData" :
1086
- opts .SetRawBucketsData (val .Boolean ())
1092
+ opts .SetRawData (val .Boolean ())
1087
1093
default :
1088
1094
return nil , fmt .Errorf ("unrecognized insertMany option %q" , key )
1089
1095
}
@@ -1135,7 +1141,7 @@ func executeInsertOne(ctx context.Context, operation *operation) (*operationResu
1135
1141
case "comment" :
1136
1142
opts .SetComment (val )
1137
1143
case "rawData" :
1138
- opts .SetRawBucketsData (val .Boolean ())
1144
+ opts .SetRawData (val .Boolean ())
1139
1145
default :
1140
1146
return nil , fmt .Errorf ("unrecognized insertOne option %q" , key )
1141
1147
}
@@ -1180,6 +1186,8 @@ func executeListIndexes(ctx context.Context, operation *operation) (*operationRe
1180
1186
switch key {
1181
1187
case "batchSize" :
1182
1188
opts .SetBatchSize (val .Int32 ())
1189
+ case "rawData" :
1190
+ opts .SetRawData (val .Boolean ())
1183
1191
default :
1184
1192
return nil , fmt .Errorf ("unrecognized listIndexes option: %q" , key )
1185
1193
}
@@ -1327,7 +1335,7 @@ func executeReplaceOne(ctx context.Context, operation *operation) (*operationRes
1327
1335
case "let" :
1328
1336
opts .SetLet (val .Document ())
1329
1337
case "rawData" :
1330
- opts .SetRawBucketsData (val .Boolean ())
1338
+ opts .SetRawData (val .Boolean ())
1331
1339
default :
1332
1340
return nil , fmt .Errorf ("unrecognized replaceOne option %q" , key )
1333
1341
}
@@ -1527,7 +1535,7 @@ func createFindCursor(ctx context.Context, operation *operation) (*cursorResult,
1527
1535
maxAwaitTimeMS := time .Duration (val .Int32 ()) * time .Millisecond
1528
1536
opts .SetMaxAwaitTime (maxAwaitTimeMS )
1529
1537
case "rawData" :
1530
- opts .SetRawBucketsData (val .Boolean ())
1538
+ opts .SetRawData (val .Boolean ())
1531
1539
default :
1532
1540
return nil , fmt .Errorf ("unrecognized find option %q" , key )
1533
1541
}
0 commit comments