-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-49623 Upgrade versions #531
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
Merged
stephmarie17
merged 4 commits into
mongodb:comp-cov
from
stephmarie17:docsp-49623-upgradeMajorVersions
Jul 8, 2025
Merged
Changes from 3 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,106 @@ | ||
.. TODO | ||
.. _golang-upgrade: | ||
|
||
======================= | ||
Upgrade Driver Versions | ||
======================= | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 1 | ||
:class: singlecol | ||
|
||
.. facet:: | ||
:name: genre | ||
:values: reference | ||
|
||
.. meta:: | ||
:keywords: compatibility, backwards compatibility | ||
|
||
Overview | ||
-------- | ||
|
||
This page describes the changes you must make to your application | ||
when you upgrade to a new version of {+driver-short+}. | ||
|
||
Before you upgrade, perform the following actions: | ||
|
||
- Ensure the new {+driver-short+} version is compatible with the {+mdb-server+} | ||
version your application connects to and the Go version your application runs | ||
on. For more information, see the :ref:`Compatibility <golang-compatibility>` | ||
page. | ||
|
||
- Address any breaking changes between the driver versions your application uses | ||
and your planned upgrade version in the :ref:`Breaking Changes | ||
<golang-breaking-changes>` section. | ||
|
||
.. tip:: | ||
|
||
To minimize the number of changes your application requires when | ||
upgrading driver versions in the future, use the :ref:`{+stable-api+} <golang-stable-api>`. | ||
|
||
.. _golang-breaking-changes: | ||
|
||
Breaking Changes | ||
---------------- | ||
|
||
A breaking change is a change of a convention or a behavior starting in a specific | ||
version of the driver. This type of change may prevent your application from working | ||
properly if not addressed before upgrading the driver. | ||
|
||
The breaking changes in this section are categorized by the driver version that introduced | ||
them. When upgrading driver versions, address all the breaking changes between the current | ||
and upgrade versions. | ||
|
||
.. _version-2.2-breaking-changes: | ||
|
||
Version 2.2 Breaking Changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Drops support for {+mdb-server+} v3.6. The minimum supported {+mdb-server+} | ||
version is now v4.0. This also drops support for the ``MONGODB-CR`` authentication | ||
mechanism. To learn more about compatibility with {+mdb-server+} | ||
versions, see the :ref:`Compatibility <golang-compatibility>` reference. | ||
|
||
.. _version-2.0-breaking-changes: | ||
|
||
Version 2.0 Breaking Changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- ``mongo.Connect()`` does not accept a Context parameter. This | ||
method accepts only an options object. To view an example that uses this | ||
method, see the :ref:`Connection Example Code <go-connection-example-code>` | ||
in the Connection Guide. | ||
|
||
- The ``Cursor.SetMaxTime()`` method is renamed to | ||
``Cursor.SetMaxAwaitTime()``. This method specifies the maximum time | ||
that the server waits for new documents retrieved from a capped | ||
collection with a tailable cursor. | ||
|
||
- Removal of operation-specific timeout options. The following fields | ||
and setter methods have been removed from the driver: | ||
|
||
- ``AggregateOptions.MaxTime``, ``AggregateOptions.SetMaxTime()`` | ||
- ``ClientOptions.SocketTimeout``, ``ClientOptions.SetSocketTimeout()`` | ||
- ``CountOptions.MaxTime``, ``CountOptions.SetMaxTime()`` | ||
- ``DistinctOptions.MaxTime``, ``DistinctOptions.SetMaxTime()`` | ||
- ``EstimatedDocumentCountOptions.MaxTime``, ``EstimatedDocumentCountOptions.SetMaxTime()`` | ||
- ``FindOptions.MaxTime``, ``FindOptions.SetMaxTime()`` | ||
- ``FindOneOptions.MaxTime``, ``FindOneOptions.SetMaxTime()`` | ||
- ``FindOneAndReplaceOptions.MaxTime``, ``FindOneAndReplaceOptions.SetMaxTime()`` | ||
- ``FindOneAndUpdateOptions.MaxTime``, ``FindOneAndUpdateOptions.SetMaxTime()`` | ||
- ``GridFSFindOptions.MaxTime``, ``GridFSFindOptions.SetMaxTime()`` | ||
- ``CreateIndexesOptions.MaxTime``, ``CreateIndexesOptions.SetMaxTime()`` | ||
- ``DropIndexesOptions.MaxTime``, ``DropIndexesOptions.SetMaxTime()`` | ||
- ``ListIndexesOptions.MaxTime``, ``ListIndexesOptions.SetMaxTime()`` | ||
- ``SessionOptions.DefaultMaxCommitTime``, ``SessionOptions.SetDefaultMaxCommitTime()`` | ||
- ``TransactionOptions.MaxCommitTime``, ``TransactionOptions.SetMaxCommitTime()`` | ||
- ``WriteConcern.WTimeout`` | ||
|
||
Instead, you can set a timeout on your client or within a Context. | ||
Learn more in the :ref:`golang-csot` guide. | ||
|
||
- Removal of the ``bson/primitive`` package. This package is now merged with | ||
the ``bson`` package. To update your code, remove any ``bson/primitive`` | ||
import statements and change any instance of ``primitive.ObjectID`` to | ||
``bson.ObjectId``. | ||
stephmarie17 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.