-
Notifications
You must be signed in to change notification settings - Fork 918
GODRIVER-3499 Update v2 migration guide. #1987
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 1 commit
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -503,7 +503,7 @@ mongo.WithSession(context.TODO(),sess,func(ctx context.Context) error { | |||||||||
|
|
||||||||||
| ## Options Package | ||||||||||
|
|
||||||||||
| `ClientOptions.AuthenticateToAnything` was marked for internal use in 1.x and does not have a replacement. | ||||||||||
| `ClientOptions.AuthenticateToAnything` was removed in 2.0 (it was marked for internal use in 1.x). | ||||||||||
|
|
||||||||||
| The following fields were removed because they are no longer supported by the server | ||||||||||
|
|
||||||||||
|
|
@@ -633,10 +633,14 @@ The following types are not valid for a `findOne` operation and have been remove | |||||||||
| - `MaxAwaitTime` | ||||||||||
| - `NoCursorTimeout` | ||||||||||
|
|
||||||||||
| The data type of `ArrayFilters` has been changed to `[]interface{}`, which can be used as the `Filters` field in the original `ArrayFilters` struct. | ||||||||||
|
|
||||||||||
| ### UpdateManyOptions / UpdateOneOptions | ||||||||||
|
|
||||||||||
| The `UpdateOptions` has been separated into `UpdateManyOptions` and `UpdateOneOptions` to configure the corresponding `UpdateMany` and `UpdateOne` operations. | ||||||||||
|
|
||||||||||
| The data type of `ArrayFilters` in the `Update*Options` has been changed to `[]interface{}`, which can be used as the `Filters` field in the original `ArrayFilters` struct. | ||||||||||
|
||||||||||
| The data type of `ArrayFilters` in the `Update*Options` has been changed to `[]interface{}`, which can be used as the `Filters` field in the original `ArrayFilters` struct. | |
| The `ArrayFilters` struct type has been removed in v2. Correspondingly, the data type of `ArrayFilters` in the `UpdateOptions` struct has been changed to `[]interface{}` in the `UpdateManyOptions` and `UpdateOneOptions` structs. The new `ArrayFilters` field (with the `[]interface{}` type) can be used as the `Filters` field in the original `ArrayFilters` struct. |
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.
I looked up the code change and see what you mean now. What made this confusing is that both the field and the struct type had the same name.
How about this:
| The data type of `ArrayFilters` in the `Update*Options` has been changed to `[]interface{}`, which can be used as the `Filters` field in the original `ArrayFilters` struct. | |
| The `ArrayFilters` struct type has been removed in v2. As a result, the `ArrayFilters` fields in the new `UpdateManyOptions` and `UpdateOneOptions` structs (which replace the old `UpdateOptions` struct) now use the `[]interface{}` type. The `ArrayFilters` field (now of type `[]interface{}`) serves the same purpose as the `Filters` field in the original `ArrayFilters` struct. |
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.
would "and" possibly make more sense that "which" here? will defer to @matthewdale
Uh oh!
There was an error while loading. Please reload this page.
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.
This one should be similar to the one below right?
Should we change this section to "### FindOneOptions / FindOneAndUpdateOptions"?