From 772af161912ed21ef759613bd9e935368ff6a27c Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Wed, 12 Mar 2025 16:05:04 -0400 Subject: [PATCH 1/2] Update v2 migration guide. --- docs/migration-2.0.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/migration-2.0.md b/docs/migration-2.0.md index 056476799b..7a4136a426 100644 --- a/docs/migration-2.0.md +++ b/docs/migration-2.0.md @@ -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. + ### Merge\*Options All functions that merge options have been removed in favor of a generic solution. See [GODRIVER-2696](https://jira.mongodb.org/browse/GODRIVER-2696) for more information. From ce42479b5807cbb2aa44361a26e20b42c57f7880 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Fri, 14 Mar 2025 18:58:12 -0400 Subject: [PATCH 2/2] updates --- docs/migration-2.0.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/migration-2.0.md b/docs/migration-2.0.md index 7a4136a426..b98bf6bffd 100644 --- a/docs/migration-2.0.md +++ b/docs/migration-2.0.md @@ -503,7 +503,7 @@ mongo.WithSession(context.TODO(),sess,func(ctx context.Context) error { ## Options Package -`ClientOptions.AuthenticateToAnything` was removed in 2.0 (it was marked for internal use in 1.x). +`ClientOptions.AuthenticateToAnything` was removed in v2 (it was marked for internal use in v1). The following fields were removed because they are no longer supported by the server @@ -633,13 +633,15 @@ 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. +### FindOneAndUpdateOptions + +The `ArrayFilters` struct type has been removed in v2. As a result, the `ArrayFilters` field in the `FindOneAndUpdateOptions` struct now uses the `[]interface{}` type. The `ArrayFilters` field (now of type `[]interface{}`) serves the same purpose 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 `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. ### Merge\*Options