@@ -128,6 +128,27 @@ func SetInternalCountOptions(a *options.CountOptionsBuilder, key string, option
128128 return nil
129129}
130130
131+ // SetInternalCreateIndexesOptions sets internal options for CreateIndexesOptions.
132+ func SetInternalCreateIndexesOptions (a * options.CreateIndexesOptionsBuilder , key string , option any ) error {
133+ typeErrFunc := func (t string ) error {
134+ return fmt .Errorf ("unexpected type for %q: %T is not %s" , key , option , t )
135+ }
136+ switch key {
137+ case "rawData" :
138+ b , ok := option .(bool )
139+ if ! ok {
140+ return typeErrFunc ("bool" )
141+ }
142+ a .Opts = append (a .Opts , func (opts * options.CreateIndexesOptions ) error {
143+ opts .Internal = optionsutil .WithValue (opts .Internal , key , b )
144+ return nil
145+ })
146+ default :
147+ return fmt .Errorf ("unsupported option: %q" , key )
148+ }
149+ return nil
150+ }
151+
131152// SetInternalDeleteOneOptions sets internal options for DeleteOneOptions.
132153func SetInternalDeleteOneOptions (a * options.DeleteOneOptionsBuilder , key string , option any ) error {
133154 typeErrFunc := func (t string ) error {
@@ -191,6 +212,27 @@ func SetInternalDistinctOptions(a *options.DistinctOptionsBuilder, key string, o
191212 return nil
192213}
193214
215+ // SetInternalDropIndexesOptions sets internal options for DropIndexesOptions.
216+ func SetInternalDropIndexesOptions (a * options.DropIndexesOptionsBuilder , key string , option any ) error {
217+ typeErrFunc := func (t string ) error {
218+ return fmt .Errorf ("unexpected type for %q: %T is not %s" , key , option , t )
219+ }
220+ switch key {
221+ case "rawData" :
222+ b , ok := option .(bool )
223+ if ! ok {
224+ return typeErrFunc ("bool" )
225+ }
226+ a .Opts = append (a .Opts , func (opts * options.DropIndexesOptions ) error {
227+ opts .Internal = optionsutil .WithValue (opts .Internal , key , b )
228+ return nil
229+ })
230+ default :
231+ return fmt .Errorf ("unsupported option: %q" , key )
232+ }
233+ return nil
234+ }
235+
194236// SetInternalEstimatedDocumentCountOptions sets internal options for EstimatedDocumentCountOptions.
195237func SetInternalEstimatedDocumentCountOptions (a * options.EstimatedDocumentCountOptionsBuilder , key string , option any ) error {
196238 typeErrFunc := func (t string ) error {
@@ -380,6 +422,27 @@ func SetInternalListCollectionsOptions(a *options.ListCollectionsOptionsBuilder,
380422 return nil
381423}
382424
425+ // SetInternalListIndexesOptions sets internal options for ListIndexesOptions.
426+ func SetInternalListIndexesOptions (a * options.ListIndexesOptionsBuilder , key string , option any ) error {
427+ typeErrFunc := func (t string ) error {
428+ return fmt .Errorf ("unexpected type for %q: %T is not %s" , key , option , t )
429+ }
430+ switch key {
431+ case "rawData" :
432+ b , ok := option .(bool )
433+ if ! ok {
434+ return typeErrFunc ("bool" )
435+ }
436+ a .Opts = append (a .Opts , func (opts * options.ListIndexesOptions ) error {
437+ opts .Internal = optionsutil .WithValue (opts .Internal , key , b )
438+ return nil
439+ })
440+ default :
441+ return fmt .Errorf ("unsupported option: %q" , key )
442+ }
443+ return nil
444+ }
445+
383446// SetInternalReplaceOptions sets internal options for ReplaceOptions.
384447func SetInternalReplaceOptions (a * options.ReplaceOptionsBuilder , key string , option any ) error {
385448 typeErrFunc := func (t string ) error {
0 commit comments