Skip to content

Commit 9f45831

Browse files
authored
DOCSP-49623 Upgrade versions (#531)
1 parent 7f4b6a0 commit 9f45831

File tree

2 files changed

+109
-49
lines changed

2 files changed

+109
-49
lines changed

source/reference/release-notes.txt

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,8 @@ What's New in 2.2
4949

5050
.. important:: Breaking Change
5151

52-
The {+driver-short+} v2.2 release introduces the following breaking
53-
change:
54-
55-
- Drops support for {+mdb-server+} v3.6. The minimum supported {+mdb-server+}
56-
version is now v4.0. This also drops support for the ``MONGODB-CR`` authentication
57-
mechanism. To learn more about compatibility with {+mdb-server+}
58-
versions, see the :ref:`Compatibility <golang-compatibility>` reference.
52+
The {+driver-short+} v2.2 release contains breaking changes. For more
53+
information, see :ref:`version-2.2-breaking-changes`.
5954

6055
This release includes the following improvements and fixes:
6156

@@ -130,47 +125,8 @@ in the {+driver-short+} source code on GitHub.
130125

131126
.. important:: Breaking Changes
132127

133-
The {+driver-short+} v2.0 release introduces the following breaking
134-
changes:
135-
136-
- ``mongo.Connect()`` does not accept a Context parameter. This
137-
method accepts only an options object. To view an example that uses
138-
this method, see the :ref:`Connection Example Code
139-
<go-connection-example-code>` in the Connection Guide.
140-
141-
- The ``Cursor.SetMaxTime()`` method is renamed to
142-
``Cursor.SetMaxAwaitTime()``. This method specifies the maximum time
143-
that the server waits for new documents retrieved from a capped
144-
collection with a tailable cursor.
145-
146-
- Removal of operation-specific timeout options. The following fields
147-
and setter methods have been removed from the driver:
148-
149-
- ``AggregateOptions.MaxTime``, ``AggregateOptions.SetMaxTime()``
150-
- ``ClientOptions.SocketTimeout``, ``ClientOptions.SetSocketTimeout()``
151-
- ``CountOptions.MaxTime``, ``CountOptions.SetMaxTime()``
152-
- ``DistinctOptions.MaxTime``, ``DistinctOptions.SetMaxTime()``
153-
- ``EstimatedDocumentCountOptions.MaxTime``, ``EstimatedDocumentCountOptions.SetMaxTime()``
154-
- ``FindOptions.MaxTime``, ``FindOptions.SetMaxTime()``
155-
- ``FindOneOptions.MaxTime``, ``FindOneOptions.SetMaxTime()``
156-
- ``FindOneAndReplaceOptions.MaxTime``, ``FindOneAndReplaceOptions.SetMaxTime()``
157-
- ``FindOneAndUpdateOptions.MaxTime``, ``FindOneAndUpdateOptions.SetMaxTime()``
158-
- ``GridFSFindOptions.MaxTime``, ``GridFSFindOptions.SetMaxTime()``
159-
- ``CreateIndexesOptions.MaxTime``, ``CreateIndexesOptions.SetMaxTime()``
160-
- ``DropIndexesOptions.MaxTime``, ``DropIndexesOptions.SetMaxTime()``
161-
- ``ListIndexesOptions.MaxTime``, ``ListIndexesOptions.SetMaxTime()``
162-
- ``SessionOptions.DefaultMaxCommitTime``, ``SessionOptions.SetDefaultMaxCommitTime()``
163-
- ``TransactionOptions.MaxCommitTime``, ``TransactionOptions.SetMaxCommitTime()``
164-
- ``WriteConcern.WTimeout``
165-
166-
Instead, you can set a timeout on your client or within a Context.
167-
Learn more in the :ref:`golang-timeout-setting` section of the
168-
Connection Options guide.
169-
170-
- Removal of the ``bson/primitive`` package. This package is now merged with
171-
the ``bson`` package. To update your code, remove any ``bson/primitive``
172-
import statements and change any instance of ``primitive.ObjectID`` to
173-
``bson.ObjectId``.
128+
The {+driver-short+} v2.0 release contains breaking changes. For more
129+
information, see :ref:`version-2.0-breaking-changes`.
174130

175131
This release includes the following improvements and fixes:
176132

source/reference/upgrade.txt

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,106 @@
1-
.. TODO
1+
.. _golang-upgrade:
22

3+
=======================
4+
Upgrade Driver Versions
5+
=======================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
.. facet::
14+
:name: genre
15+
:values: reference
16+
17+
.. meta::
18+
:keywords: compatibility, backwards compatibility
19+
20+
Overview
21+
--------
22+
23+
This page describes the changes you must make to your application
24+
when you upgrade to a new version of the {+driver-short+}.
25+
26+
Before you upgrade, perform the following actions:
27+
28+
- Ensure the new {+driver-short+} version is compatible with the {+mdb-server+}
29+
version your application connects to and the Go version your application runs
30+
on. For more information, see the :ref:`Compatibility <golang-compatibility>`
31+
page.
32+
33+
- Address any breaking changes between the driver versions your application uses
34+
and your planned upgrade version in the :ref:`Breaking Changes
35+
<golang-breaking-changes>` section.
36+
37+
.. tip::
38+
39+
To minimize the number of changes your application requires when
40+
upgrading driver versions in the future, use the :ref:`{+stable-api+} <golang-stable-api>`.
41+
42+
.. _golang-breaking-changes:
43+
44+
Breaking Changes
45+
----------------
46+
47+
A breaking change is a change of a convention or a behavior starting in a specific
48+
version of the driver. This type of change may prevent your application from working
49+
properly if not addressed before upgrading the driver.
50+
51+
The breaking changes in this section are categorized by the driver version that introduced
52+
them. When upgrading driver versions, address all the breaking changes between the current
53+
and upgrade versions.
54+
55+
.. _version-2.2-breaking-changes:
56+
57+
Version 2.2 Breaking Changes
58+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59+
60+
- Drops support for {+mdb-server+} v3.6. The minimum supported {+mdb-server+}
61+
version is now v4.0. This also drops support for the ``MONGODB-CR`` authentication
62+
mechanism. To learn more about compatibility with {+mdb-server+}
63+
versions, see the :ref:`Compatibility <golang-compatibility>` reference.
64+
65+
.. _version-2.0-breaking-changes:
66+
67+
Version 2.0 Breaking Changes
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
70+
- ``mongo.Connect()`` does not accept a Context parameter. This
71+
method accepts only an options object. To view an example that uses this
72+
method, see the :ref:`Connection Example Code <go-connection-example-code>`
73+
in the Connection Guide.
74+
75+
- The ``Cursor.SetMaxTime()`` method is renamed to
76+
``Cursor.SetMaxAwaitTime()``. This method specifies the maximum time
77+
that the server waits for new documents retrieved from a capped
78+
collection with a tailable cursor.
79+
80+
- Removal of operation-specific timeout options. The following fields
81+
and setter methods have been removed from the driver:
82+
83+
- ``AggregateOptions.MaxTime``, ``AggregateOptions.SetMaxTime()``
84+
- ``ClientOptions.SocketTimeout``, ``ClientOptions.SetSocketTimeout()``
85+
- ``CountOptions.MaxTime``, ``CountOptions.SetMaxTime()``
86+
- ``DistinctOptions.MaxTime``, ``DistinctOptions.SetMaxTime()``
87+
- ``EstimatedDocumentCountOptions.MaxTime``, ``EstimatedDocumentCountOptions.SetMaxTime()``
88+
- ``FindOptions.MaxTime``, ``FindOptions.SetMaxTime()``
89+
- ``FindOneOptions.MaxTime``, ``FindOneOptions.SetMaxTime()``
90+
- ``FindOneAndReplaceOptions.MaxTime``, ``FindOneAndReplaceOptions.SetMaxTime()``
91+
- ``FindOneAndUpdateOptions.MaxTime``, ``FindOneAndUpdateOptions.SetMaxTime()``
92+
- ``GridFSFindOptions.MaxTime``, ``GridFSFindOptions.SetMaxTime()``
93+
- ``CreateIndexesOptions.MaxTime``, ``CreateIndexesOptions.SetMaxTime()``
94+
- ``DropIndexesOptions.MaxTime``, ``DropIndexesOptions.SetMaxTime()``
95+
- ``ListIndexesOptions.MaxTime``, ``ListIndexesOptions.SetMaxTime()``
96+
- ``SessionOptions.DefaultMaxCommitTime``, ``SessionOptions.SetDefaultMaxCommitTime()``
97+
- ``TransactionOptions.MaxCommitTime``, ``TransactionOptions.SetMaxCommitTime()``
98+
- ``WriteConcern.WTimeout``
99+
100+
Instead, you can set a timeout on your client or within a Context.
101+
Learn more in the :ref:`golang-csot` guide.
102+
103+
- Removal of the ``bson/primitive`` package. This package is now merged with
104+
the ``bson`` package. To update your code, remove any ``bson/primitive``
105+
import statements and change any instance of ``primitive.ObjectID`` to
106+
``bson.ObjectId``.

0 commit comments

Comments
 (0)