@@ -76,7 +76,7 @@ func executeAggregate(ctx context.Context, operation *operation) (*operationResu
7676 case "let" :
7777 opts .SetLet (val .Document ())
7878 case "rawData" :
79- opts .SetRawBucketsData (val .Boolean ())
79+ opts .SetRawData (val .Boolean ())
8080 default :
8181 return nil , fmt .Errorf ("unrecognized aggregate option %q" , key )
8282 }
@@ -128,7 +128,7 @@ func executeBulkWrite(ctx context.Context, operation *operation) (*operationResu
128128 case "let" :
129129 opts .SetLet (val .Document ())
130130 case "rawData" :
131- opts .SetRawBucketsData (val .Boolean ())
131+ opts .SetRawData (val .Boolean ())
132132 default :
133133 return nil , fmt .Errorf ("unrecognized bulkWrite option %q" , key )
134134 }
@@ -207,7 +207,7 @@ func executeCountDocuments(ctx context.Context, operation *operation) (*operatio
207207 case "skip" :
208208 opts .SetSkip (int64 (val .Int32 ()))
209209 case "rawData" :
210- opts .SetRawBucketsData (val .Boolean ())
210+ opts .SetRawData (val .Boolean ())
211211 default :
212212 return nil , fmt .Errorf ("unrecognized countDocuments option %q" , key )
213213 }
@@ -231,6 +231,7 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
231231
232232 var keys bson.Raw
233233 indexOpts := options .Index ()
234+ opts := options .CreateIndexes ()
234235
235236 elems , err := operation .Arguments .Elements ()
236237 if err != nil {
@@ -285,6 +286,8 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
285286 indexOpts .SetWeights (val .Document ())
286287 case "wildcardProjection" :
287288 indexOpts .SetWildcardProjection (val .Document ())
289+ case "rawData" :
290+ opts .SetRawData (val .Boolean ())
288291 default :
289292 return nil , fmt .Errorf ("unrecognized createIndex option %q" , key )
290293 }
@@ -297,7 +300,8 @@ func executeCreateIndex(ctx context.Context, operation *operation) (*operationRe
297300 Keys : keys ,
298301 Options : indexOpts ,
299302 }
300- name , err := coll .Indexes ().CreateOne (ctx , model )
303+
304+ name , err := coll .Indexes ().CreateOne (ctx , model , opts )
301305 return newValueResult (bson .TypeString , bsoncore .AppendString (nil , name ), err ), nil
302306}
303307
@@ -440,7 +444,7 @@ func executeDeleteOne(ctx context.Context, operation *operation) (*operationResu
440444 case "let" :
441445 opts .SetLet (val .Document ())
442446 case "rawData" :
443- opts .SetRawBucketsData (val .Boolean ())
447+ opts .SetRawData (val .Boolean ())
444448 default :
445449 return nil , fmt .Errorf ("unrecognized deleteOne option %q" , key )
446450 }
@@ -496,7 +500,7 @@ func executeDeleteMany(ctx context.Context, operation *operation) (*operationRes
496500 case "let" :
497501 opts .SetLet (val .Document ())
498502 case "rawData" :
499- opts .SetRawBucketsData (val .Boolean ())
503+ opts .SetRawData (val .Boolean ())
500504 default :
501505 return nil , fmt .Errorf ("unrecognized deleteMany option %q" , key )
502506 }
@@ -556,7 +560,7 @@ func executeDistinct(ctx context.Context, operation *operation) (*operationResul
556560 // this error.
557561 return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
558562 case "rawData" :
559- opts .SetRawBucketsData (val .Boolean ())
563+ opts .SetRawData (val .Boolean ())
560564 default :
561565 return nil , fmt .Errorf ("unrecognized distinct option %q" , key )
562566 }
@@ -605,6 +609,8 @@ func executeDropIndex(ctx context.Context, operation *operation) (*operationResu
605609 // ensured an analogue exists, extend "skippedTestDescriptions" to avoid
606610 // this error.
607611 return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
612+ case "rawData" :
613+ dropIndexOpts .SetRawData (val .Boolean ())
608614 default :
609615 return nil , fmt .Errorf ("unrecognized dropIndex option %q" , key )
610616 }
@@ -703,7 +709,7 @@ func executeEstimatedDocumentCount(ctx context.Context, operation *operation) (*
703709 // this error.
704710 return nil , fmt .Errorf ("the maxTimeMS collection option is not supported" )
705711 case "rawData" :
706- opts .SetRawBucketsData (val .Boolean ())
712+ opts .SetRawData (val .Boolean ())
707713 default :
708714 return nil , fmt .Errorf ("unrecognized estimatedDocumentCount option %q" , key )
709715 }
@@ -857,7 +863,7 @@ func executeFindOneAndDelete(ctx context.Context, operation *operation) (*operat
857863 case "let" :
858864 opts .SetLet (val .Document ())
859865 case "rawData" :
860- opts .SetRawBucketsData (val .Boolean ())
866+ opts .SetRawData (val .Boolean ())
861867 default :
862868 return nil , fmt .Errorf ("unrecognized findOneAndDelete option %q" , key )
863869 }
@@ -941,7 +947,7 @@ func executeFindOneAndReplace(ctx context.Context, operation *operation) (*opera
941947 case "upsert" :
942948 opts .SetUpsert (val .Boolean ())
943949 case "rawData" :
944- opts .SetRawBucketsData (val .Boolean ())
950+ opts .SetRawData (val .Boolean ())
945951 default :
946952 return nil , fmt .Errorf ("unrecognized findOneAndReplace option %q" , key )
947953 }
@@ -1035,7 +1041,7 @@ func executeFindOneAndUpdate(ctx context.Context, operation *operation) (*operat
10351041 case "upsert" :
10361042 opts .SetUpsert (val .Boolean ())
10371043 case "rawData" :
1038- opts .SetRawBucketsData (val .Boolean ())
1044+ opts .SetRawData (val .Boolean ())
10391045 default :
10401046 return nil , fmt .Errorf ("unrecognized findOneAndUpdate option %q" , key )
10411047 }
@@ -1083,7 +1089,7 @@ func executeInsertMany(ctx context.Context, operation *operation) (*operationRes
10831089 case "ordered" :
10841090 opts .SetOrdered (val .Boolean ())
10851091 case "rawData" :
1086- opts .SetRawBucketsData (val .Boolean ())
1092+ opts .SetRawData (val .Boolean ())
10871093 default :
10881094 return nil , fmt .Errorf ("unrecognized insertMany option %q" , key )
10891095 }
@@ -1135,7 +1141,7 @@ func executeInsertOne(ctx context.Context, operation *operation) (*operationResu
11351141 case "comment" :
11361142 opts .SetComment (val )
11371143 case "rawData" :
1138- opts .SetRawBucketsData (val .Boolean ())
1144+ opts .SetRawData (val .Boolean ())
11391145 default :
11401146 return nil , fmt .Errorf ("unrecognized insertOne option %q" , key )
11411147 }
@@ -1180,6 +1186,8 @@ func executeListIndexes(ctx context.Context, operation *operation) (*operationRe
11801186 switch key {
11811187 case "batchSize" :
11821188 opts .SetBatchSize (val .Int32 ())
1189+ case "rawData" :
1190+ opts .SetRawData (val .Boolean ())
11831191 default :
11841192 return nil , fmt .Errorf ("unrecognized listIndexes option: %q" , key )
11851193 }
@@ -1327,7 +1335,7 @@ func executeReplaceOne(ctx context.Context, operation *operation) (*operationRes
13271335 case "let" :
13281336 opts .SetLet (val .Document ())
13291337 case "rawData" :
1330- opts .SetRawBucketsData (val .Boolean ())
1338+ opts .SetRawData (val .Boolean ())
13311339 default :
13321340 return nil , fmt .Errorf ("unrecognized replaceOne option %q" , key )
13331341 }
@@ -1527,7 +1535,7 @@ func createFindCursor(ctx context.Context, operation *operation) (*cursorResult,
15271535 maxAwaitTimeMS := time .Duration (val .Int32 ()) * time .Millisecond
15281536 opts .SetMaxAwaitTime (maxAwaitTimeMS )
15291537 case "rawData" :
1530- opts .SetRawBucketsData (val .Boolean ())
1538+ opts .SetRawData (val .Boolean ())
15311539 default :
15321540 return nil , fmt .Errorf ("unrecognized find option %q" , key )
15331541 }
0 commit comments