Migrate go mongo driver to v2#106
Merged
Merged
Conversation
vikasbolla
force-pushed
the
migrate_mongo_driver_v2
branch
from
July 8, 2026 09:57
eaa6d54 to
523a1d6
Compare
anshuman-agarwala
requested changes
Jul 9, 2026
vikasbolla
force-pushed
the
migrate_mongo_driver_v2
branch
from
July 9, 2026 06:47
523a1d6 to
414f7d7
Compare
GunaKKIBM
reviewed
Jul 10, 2026
| github.com/swaggo/swag v1.16.6 | ||
| github.com/tbaehler/gin-keycloak v1.7.0 | ||
| go.mongodb.org/mongo-driver v1.17.7 | ||
| go.mongodb.org/mongo-driver/v2 v2.2.0 |
Member
There was a problem hiding this comment.
Can we update to v2.6.x ? this was released in 2025
Contributor
Author
There was a problem hiding this comment.
Done, I have added now, thank you
GunaKKIBM
reviewed
Jul 10, 2026
| opts := options.Client().ApplyURI(db.URI).SetServerAPIOptions(serverAPI) | ||
| client, err := mongo.Connect(context.TODO(), opts) | ||
| client, err := mongo.Connect(opts) | ||
| if err != nil { |
Member
There was a problem hiding this comment.
JFYI, https://pkg.go.dev/go.mongodb.org/mongo-driver/v2@v2.8.0/mongo/options#ClientOptions.SetDialer - I think would be the way to go, if we need to set context
Signed-off-by: Vikas <vikas.satyanarayana.bolla@ibm.com>
vikasbolla
force-pushed
the
migrate_mongo_driver_v2
branch
from
July 14, 2026 07:01
414f7d7 to
3addf33
Compare
Member
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the mongo driver 1.x is getting deprecated, we had to migrate to v2 version as mentioned here-https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo.
I have tested this by branch deployment in the staging env.