-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-3522 Add support for the rawData option for time-series bucket access - PR0 #2121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
a9f34ad
547db1d
b1bb1fc
4485d8e
b573bb7
6724da3
244ab64
6a2e0d4
53f0226
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ package options | |
| type InsertOneOptions struct { | ||
| BypassDocumentValidation *bool | ||
| Comment interface{} | ||
| RawData *bool | ||
| } | ||
|
|
||
| // InsertOneOptionsBuilder represents functional options that configure an | ||
|
|
@@ -53,6 +54,18 @@ func (ioo *InsertOneOptionsBuilder) SetComment(comment interface{}) *InsertOneOp | |
| return ioo | ||
| } | ||
|
|
||
| // SetRawData sets the value for the RawData field. If true, it allows the CRUD operations to access timeseries | ||
| // collections on the bucket-level. This option is only valid for MongoDB versions >= 9.0. The default value is false. | ||
| func (ioo *InsertOneOptionsBuilder) SetRawData(rawData bool) *InsertOneOptionsBuilder { | ||
|
||
| ioo.Opts = append(ioo.Opts, func(ioo *InsertOneOptions) error { | ||
| ioo.RawData = &rawData | ||
|
|
||
| return nil | ||
| }) | ||
|
|
||
| return ioo | ||
| } | ||
|
|
||
| // InsertManyOptions represents arguments that can be used to configure an | ||
| // InsertMany operation. | ||
| // | ||
|
|
@@ -61,6 +74,7 @@ type InsertManyOptions struct { | |
| BypassDocumentValidation *bool | ||
| Comment interface{} | ||
| Ordered *bool | ||
| RawData *bool | ||
| } | ||
|
|
||
| // InsertManyOptionsBuilder contains options to configure insert operations. | ||
|
|
@@ -121,3 +135,15 @@ func (imo *InsertManyOptionsBuilder) SetOrdered(b bool) *InsertManyOptionsBuilde | |
|
|
||
| return imo | ||
| } | ||
|
|
||
| // SetRawData sets the value for the RawData field. If true, it allows the CRUD operations to access timeseries | ||
| // collections on the bucket-level. This option is only valid for MongoDB versions >= 9.0. The default value is false. | ||
| func (imo *InsertManyOptionsBuilder) SetRawData(rawData bool) *InsertManyOptionsBuilder { | ||
| imo.Opts = append(imo.Opts, func(opts *InsertManyOptions) error { | ||
| opts.RawData = &rawData | ||
|
|
||
| return nil | ||
| }) | ||
|
|
||
| return imo | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a note that enabling it on pre-9.0 server versions has no effect. This applies for all
SetRawDatadocs.Note: This comment is irrelevant if we convert RawData into an internal-only option.