forked from mongodb/docs-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
whats-new.txt
417 lines (265 loc) · 12.6 KB
/
whats-new.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
.. _golang-whats-new:
==========
What's New
==========
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. tip:: Release Notes
To learn more about changes and updates between versions, you can
read the `release notes
<https://github.com/mongodb/mongo-go-driver/tags>`__ published with the driver source code.
Learn what's new in:
* :ref:`Version 1.12.1 <version-1.12.1>`
* :ref:`Version 1.12 <version-1.12>`
* :ref:`Version 1.11 <version-1.11>`
* :ref:`Version 1.10 <version-1.10>`
* :ref:`Version 1.9 <version-1.9>`
* :ref:`Version 1.8 <version-1.8>`
* :ref:`Version 1.7 <version-1.7>`
* :ref:`Version 1.6 <version-1.6>`
* :ref:`Version 1.5 <version-1.5>`
* :ref:`Version 1.4 <version-1.4>`
* :ref:`Version 1.3 <version-1.3>`
* :ref:`Version 1.2 <version-1.2>`
* :ref:`Version 1.1 <version-1.1>`
* :ref:`Version 1.0 <version-1.0>`
.. _version-1.12.1:
What's New in 1.12.1
--------------------
The 1.12 {+driver-short+} release includes the following improvements and fixes:
- The driver unpins connections when ending a session. This prevents connections
from leaking when a user runs a transaction while connected to a load balancer.
- The driver does not throw a runtime error when you unmarshal an empty
``bson.RawValue`` type with an invalid type or marshal a ``nil`` pointer of a ``ReadConcern`` instance.
- Setting ``options.LogComponentAll`` as the log component correctly results in the publication of logs against all components.
.. _version-1.12:
What's New in 1.12
------------------
.. important:: Deprecation Notice
- The ``mongo.NewClient()`` and ``client.Connect()`` methods are
deprecated. You can create a client and connect in one call
by using the ``mongo.Connect()`` method.
New features of the 1.12 Go driver release include:
Queryable Encryption
~~~~~~~~~~~~~~~~~~~~
This driver version adds support for :ref:`qe-manual-feature-qe` (QE). To learn
more about the requirements for using the QE feature, see the
:ref:`Queryable Encryption Driver Compatibility Table
<qe-compatibility-reference>`.
The ``ClientEncryption.CreateEncryptedCollection()``
method automatically creates data encryption keys when
you create a new encrypted collection. To learn how to use the QE
feature, see the :ref:`qe-quick-start` in the Server manual.
Logging Interface
~~~~~~~~~~~~~~~~~
You can now record connection management and command execution events by
using the ``LogSink`` logging interface.
To learn more, see the :ref:`golang-logging` Fundamentals guide.
Additional BSON Marshalling Options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This driver version adds features to the ``options`` package to specify
how the driver marshals and unmarshals BSON.
The following example shows how to set BSON options on your
``Client``. The options specify the following behaviors:
- The driver falls back to ``json`` :ref:`struct tags
<golang-struct-tags>` if ``bson`` struct tags are absent.
- The driver marshals ``nil`` Go map types as empty BSON documents.
- The driver marshals ``nil`` Go slice types as empty BSON arrays.
.. code-block:: go
bsonOpts := &options.BSONOptions{
UseJSONStructTags: true,
NilMapAsEmpty: true,
NilSliceAsEmpty: true,
}
options.Client().SetBSONOptions(bsonOpts)
For a full example of how to specify and implement the ``BSONOptions``
type, see the `API documentation <{+api+}/mongo#example-Connect-BSONOptions>`__.
Simplified Write Concern Specification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This driver version simplifies the ``WriteConcern`` API. To learn more about
the changes, see :ref:`Write Concern <golang-writeconcern>`.
Additional Changes
~~~~~~~~~~~~~~~~~~
- Support for authentication with AWS IAM roles in EKS.
- Addition of the ``Cursor.SetBatchSize()`` method to allow
specification of the size of batches fetched when iterating through a
cursor.
- Addition of the ``UnmarshalValue()`` method to allow ummarshalling of
BSON values marshalled with the ``MarshalValue()`` method.
.. _version-1.11.0:
.. _version-1.11:
What's New in 1.11
------------------
.. important:: Upgrade to Version 1.11.9 or Later
Versions 1.11.0 through 1.11.2 of the driver have been retracted because
of a bug that could cause undefined behavior when reading the ``Raw`` field
on database error types, such as ``CommandError`` and
``WriteException``.
Version 1.11.8 of the driver has been retracted because
it incorrectly contains changes intended for 1.12.1.
Upgrade to version 1.11.9 or later if you are using a retracted
version of the driver.
New features of the 1.11 Go driver release include:
- Removal of support for MongoDB versions 3.5 and older.
- Removal of support for Go versions 1.12 and older.
- Improvements to ``Timeout`` API and behavior, including:
- Modified retry logic for greater application resiliency.
- Extended ``mongo.IsTimeout`` error helper to catch more timeout errors.
- New GridFS methods that take contexts instead of using ``SetReadDeadline``
and ``SetWriteDeadline``.
- Reduced memory allocations during operation execution.
- Fix for SRV polling bug that prevented changes in SRV records when the
associated MongoDB connection string included a username and password.
- Support for :abbr:`GCP (Google Cloud Platform)` service accounts when using
Google Cloud Key Management Services.
- Improvements to server-side resource cleanup when using the ``Cursor.All`` and
``Session.WithTransaction`` functions.
- ``SERVICE_HOST`` Kerberos authentication parameter specification enabled with
the ``authMechanismProperties`` connection string option.
- Corrected output from the ``bson.Raw.String()`` method to Extended JSON
type for timestamps when the BSON document contains a UTC Timestamp
field.
- Resolution of conflicts when retrying reads with read concern
``"available"`` or ``"linearizable"``.
.. _version-1.10.0:
.. _version-1.10:
What's New in 1.10
------------------
.. important:: Upgrade to Version 1.10.1 or Higher
The 1.10.1 Go driver patches a bug that can cause data corruption when
rotating :ref:`Data Encryption Keys <csfle-key-architecture>` encrypted
with a :ref:`Customer Master Key <csfle-key-architecture>` hosted on Google
Cloud Key Management Service or Azure Key Vault.
New features of the 1.10 Go driver release include:
- Full compatibility with MongoDB 6.0.
- Support for new features related to :ref:`qe-manual-feature-qe`,
including new options for automatic and manual encryption.
- Support for the new Automatic Encryption Shared Library, which replaces the
``mongocryptd`` process. The shared library requires MongoDB v6.0 Enterprise
or later and ``libmongocrypt`` 1.5.0 or later.
- :ref:`clustered index <golang-clustered-indexes>` creation support.
- A new API and ``ClientEncryption`` entity operations for encryption key
management.
- A ``Timeout`` client option to set default context timeouts for
each operation sent through that client.
- A patch to default data to either ``primitive.M`` or ``primitive.D`` when
decoding empty types.
- Support for encoding atypical map key types for data that can be unmarshalled
into a textual representation of itself.
- Performance optimizations, including:
- Improved full document requests for before and after updates in change
stream events.
- Improved :abbr:`PRN (pseudo-random number)` and :abbr:`UUID (universally
unique identifier)` generation.
- Reduced memory consumption when compressing wire messages.
- Troubleshooting support for `frequently encountered issues.
<https://github.com/mongodb/mongo-go-driver/blob/master/docs/common-issues.md>`__
.. _version-1.9:
What's New in 1.9
-----------------
New features of the 1.9 Go driver release include:
- Improved connection storm mitigation.
- ``Custom`` options to change-stream and aggregate operations.
- ``Let`` option on most CRUD commands that specifies parameters for use
in an aggregate expression. ``Let`` must be a document that maps
parameter names to values that are constant or closed expressions without
references to document fields. MongoDB v5.0 or later is required.
- New constructor functions that create ``Cursor`` and ``SingleResult``
instances from marshalable and non-nil BSON documents.
.. _version-1.8:
What's New in 1.8
-----------------
New features of the 1.8 Go driver release include:
- Full compatibility with MongoDB 5.1.
- Support for :abbr:`KMIP (Key Management Interoperability Protocol)` as a KMS
provider for :abbr:`{+csfle-short+} ({+csfle-long+})`.
- Redesigned driver connection pool for low operation ``Context`` timeouts and
to reduce connection churn. Behavior changes include:
- New connection creation times out at ``connectTimeoutMS``.
- At most, two new connections can be established at the same time.
- Removal of oppressive and unnecessarily gendered language in the Go driver
documentation, code, tests, and spec tests.
.. _version-1.7:
What's New in 1.7
-----------------
.. important:: Upgrade to Version 1.7.2 or Higher
The 1.7.2 Go driver contains a bug fix for a data race that can occur between
creating and checking out connections when ``minPoolSize > 0``.
New features of the 1.7 Go driver release include:
- Full compatibility with MongoDB 5.0.
- Support for the :readconcern:`"snapshot"` read concern outside of
multi-document transactions for certain read operations.
- Improved ``WriteException`` and ``BulkWriteException`` error messages for
schema validation via the ``WriteError.Details`` field.
.. _version-1.6:
What's New in 1.6
-----------------
.. important:: Upgrade to Version 1.6.2 or Higher
The 1.6.2 Go driver contains a bug fix for a data race that can occur between
creating and checking out connections when ``minPoolSize > 0``.
New features of the 1.6 Go driver release include:
- Support for the MongoDB Stable API. For more information, see the
:ref:`Stable API Guide <golang-stable-api>`.
- Support for connections to any MongoDB service that runs behind a load
balancer.
- Support for creating time series collections. For more information, see
the :ref:`Time Series Collections Guide <golang-time-series>`.
- ``Let`` option for aggregate expressions.
.. _version-1.5:
What's New in 1.5
-----------------
New features of the 1.5 Go driver release include:
- Support for Azure and :abbr:`GCP (Google Cloud Platform)` key-management
services with {+csfle-long+}.
- New errors API to detect duplicate-key errors, timeouts, and network
errors.
- Server monitoring to monitor changes on a MongoDB deployment.
- Errors to prevent unexpected behavior on maps that contain multiple
keys being used as a hint option, as a sort option, or for index creation.
.. _version-1.4:
What's New in 1.4
-----------------
New features of the 1.4 Go driver release include:
- Full compatibility with MongoDB 4.4.
- Support for stapled and non-stapled OCSP verification.
- New ``tlsDisableOCSPEndpointCheck=true`` URI option to disable sending HTTP
requests if the OCSP responder is not reachable from the driver and there is
no stapled response.
- Additional context to errors encountered during BSON unmarshalling.
- Proper ``Unwrap`` functions for various driver error types.
.. _version-1.3:
What's New in 1.3
-----------------
New features of the 1.3 Go driver release include:
- ``mgocompat`` package that exports a BSON registry compatible with
``globalsign/mgo/bson``, which can be used via the
``ClientOptions.SetRegistry`` method.
- ``RegisterTypeEncoder`` and ``RegisterHookEncoder`` methods, which
replace the deprecated ``RegisterEncoder`` method. A corresponding change has
been made to replace ``RegisterDecoder``.
.. _version-1.2:
What's New in 1.2
-----------------
New features of the 1.2 Go driver release include:
- Support for {+csfle-short+}.
- ``bson.MarshalValue`` function, which marshals Go types to BSON.
- ``StringCodec``, which allows non-string fields to be decoded into a
String field in a struct.
- ``IntCodec``, ``UIntCodec``, ``BoolCodec``, and ``FloatCodec`` added to
``mgocompat`` to allow codecs to convert between numbers and booleans.
.. _version-1.1:
What's New in 1.1
-----------------
New features of the 1.1 Go driver release include:
- Full compatibility with MongoDB 4.2.
- Redesigned lower-level driver implementation to improve maintainability and
performance.
- Connection Monitoring and Pooling specifications to monitor various connection
and connection pool events with improved utilization.
.. _version-1.0:
What's New in 1.0
-----------------
This release adds no new features.