Skip to content

Commit d190ec8

Browse files
committed
add find/findAndModify
1 parent b430a2e commit d190ec8

File tree

1 file changed

+0
-84
lines changed

1 file changed

+0
-84
lines changed

x/mongo/driver/xoptions/options.go

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,6 @@ func SetInternalAggregateOptions(a *options.AggregateOptionsBuilder, key string,
6565
return nil
6666
}
6767

68-
// SetInternalBulkWriteOptions sets internal options for BulkWriteOptions.
69-
func SetInternalBulkWriteOptions(a *options.BulkWriteOptionsBuilder, key string, option any) error {
70-
typeErrFunc := func(t string) error {
71-
return fmt.Errorf("unexpected type for %q: %T is not %s", key, option, t)
72-
}
73-
switch key {
74-
case "rawData":
75-
b, ok := option.(bool)
76-
if !ok {
77-
return typeErrFunc("bool")
78-
}
79-
a.Opts = append(a.Opts, func(opts *options.BulkWriteOptions) error {
80-
opts.Internal = optionsutil.WithValue(opts.Internal, key, b)
81-
return nil
82-
})
83-
default:
84-
return fmt.Errorf("unsupported option: %q", key)
85-
}
86-
return nil
87-
}
88-
8968
// SetInternalCountOptions sets internal options for CountOptions.
9069
func SetInternalCountOptions(a *options.CountOptionsBuilder, key string, option any) error {
9170
typeErrFunc := func(t string) error {
@@ -337,66 +316,3 @@ func SetInternalInsertOneOptions(a *options.InsertOneOptionsBuilder, key string,
337316
}
338317
return nil
339318
}
340-
341-
// SetInternalReplaceOptions sets internal options for ReplaceOptions.
342-
func SetInternalReplaceOptions(a *options.ReplaceOptionsBuilder, key string, option any) error {
343-
typeErrFunc := func(t string) error {
344-
return fmt.Errorf("unexpected type for %q: %T is not %s", key, option, t)
345-
}
346-
switch key {
347-
case "rawData":
348-
b, ok := option.(bool)
349-
if !ok {
350-
return typeErrFunc("bool")
351-
}
352-
a.Opts = append(a.Opts, func(opts *options.ReplaceOptions) error {
353-
opts.Internal = optionsutil.WithValue(opts.Internal, key, b)
354-
return nil
355-
})
356-
default:
357-
return fmt.Errorf("unsupported option: %q", key)
358-
}
359-
return nil
360-
}
361-
362-
// SetInternalUpdateManyOptions sets internal options for UpdateManyOptions.
363-
func SetInternalUpdateManyOptions(a *options.UpdateManyOptionsBuilder, key string, option any) error {
364-
typeErrFunc := func(t string) error {
365-
return fmt.Errorf("unexpected type for %q: %T is not %s", key, option, t)
366-
}
367-
switch key {
368-
case "rawData":
369-
b, ok := option.(bool)
370-
if !ok {
371-
return typeErrFunc("bool")
372-
}
373-
a.Opts = append(a.Opts, func(opts *options.UpdateManyOptions) error {
374-
opts.Internal = optionsutil.WithValue(opts.Internal, key, b)
375-
return nil
376-
})
377-
default:
378-
return fmt.Errorf("unsupported option: %q", key)
379-
}
380-
return nil
381-
}
382-
383-
// SetInternalUpdateOneOptions sets internal options for UpdateOneOptions.
384-
func SetInternalUpdateOneOptions(a *options.UpdateOneOptionsBuilder, key string, option any) error {
385-
typeErrFunc := func(t string) error {
386-
return fmt.Errorf("unexpected type for %q: %T is not %s", key, option, t)
387-
}
388-
switch key {
389-
case "rawData":
390-
b, ok := option.(bool)
391-
if !ok {
392-
return typeErrFunc("bool")
393-
}
394-
a.Opts = append(a.Opts, func(opts *options.UpdateOneOptions) error {
395-
opts.Internal = optionsutil.WithValue(opts.Internal, key, b)
396-
return nil
397-
})
398-
default:
399-
return fmt.Errorf("unsupported option: %q", key)
400-
}
401-
return nil
402-
}

0 commit comments

Comments
 (0)