Skip to content

Commit 5da136c

Browse files
authored
DOCSP-30902: v1.12 release (mongodb#275)
* DOCSP-30902: v1.12 release * build * build * fix * CC and MD comments * fix manual link * cc comments
1 parent efc5faf commit 5da136c

File tree

6 files changed

+115
-10
lines changed

6 files changed

+115
-10
lines changed

config/redirects

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
define: prefix docs/drivers/go
22
define: base https://www.mongodb.com/${prefix}
3-
define: versions 1.7 1.8 1.9 1.10 1.11 master
3+
define: versions 1.7 1.8 1.9 1.10 1.11 1.12 master
44

55
symlink: current -> master
66

snooty.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
1717
driver-long = "MongoDB Go Driver"
1818
driver-short = "Go driver"
1919
docs-branch = "master" # always set this to the docs branch (i.e. master, 1.7, 1.8, etc.)
20-
version = "v1.11.6" # always set this to the driver version (i.e. v1.7.0, v1.8.0, etc.)
20+
version = "v1.12.0" # always set this to the driver version (i.e. v1.7.0, v1.8.0, etc.)
2121
example = "https://raw.githubusercontent.com/mongodb/docs-golang/{+docs-branch+}/source/includes/usage-examples/code-snippets"
2222
api = "https://pkg.go.dev/go.mongodb.org/mongo-driver@{+version+}"
2323
stable-api = "Stable API"

source/fundamentals/crud/write-read-pref.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,13 @@ requests acknowledgement from two replica set members and sets journaling to
150150
acknowledgement from the majority of replica set members.
151151

152152
.. code-block:: go
153-
:emphasize-lines: 2-6,10-11
153+
:emphasize-lines: 2-7,11-12
154154

155155
uri := "mongodb://<hostname>:<port>"
156+
journal := false
156157
cliWC := &writeconcern.WriteConcern{
157158
W: 2,
158-
Journal: false,
159+
Journal: &journal,
159160
}
160161
clOpts := options.Client().ApplyURI(uri).SetWriteConcern(cliWC)
161162
client, err := mongo.Connect(context.TODO(), clOpts)

source/includes/language-compatibility-table-go.rst

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The first column lists the driver version.
1010

1111
* - Go Driver Version
1212
- Minimum Go Language Version
13+
* - 1.12
14+
- 1.13
1315
* - 1.11
1416
- 1.13
1517
* - 1.10

source/includes/mongodb-compatibility-table-go.rst

+30-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:class: compatibility-large
55

66
* - Go Driver Version
7+
- MongoDB 7.0
78
- MongoDB 6.1
89
- MongoDB 6.0
910
- MongoDB 5.0
@@ -15,19 +16,34 @@
1516
- MongoDB 3.2
1617
- MongoDB 3.0
1718
- MongoDB 2.6
18-
* - 1.11
19+
* - 1.12
1920
- ✓
2021
- ✓
2122
- ✓
2223
- ✓
2324
- ✓
2425
- ✓
2526
- ✓
27+
- ✓
28+
-
29+
-
30+
-
31+
-
32+
* - 1.11
2633
- ⊛
27-
- ⊛
28-
- ⊛
29-
- ⊛
34+
- ✓
35+
- ✓
36+
- ✓
37+
- ✓
38+
- ✓
39+
- ✓
40+
- ✓
41+
-
42+
-
43+
-
44+
-
3045
* - 1.10
46+
- ⊛
3147
- ⊛
3248
- ✓
3349
- ✓
@@ -40,6 +56,7 @@
4056
- ✓
4157
- ✓
4258
* - 1.9
59+
- ⊛
4360
- ⊛
4461
- ⊛
4562
- ✓
@@ -52,6 +69,7 @@
5269
- ✓
5370
- ✓
5471
* - 1.8
72+
- ⊛
5573
- ⊛
5674
- ⊛
5775
- ✓
@@ -64,6 +82,7 @@
6482
- ✓
6583
- ✓
6684
* - 1.7
85+
- ⊛
6786
- ⊛
6887
- ⊛
6988
- ✓
@@ -76,6 +95,7 @@
7695
- ✓
7796
- ✓
7897
* - 1.6
98+
- ⊛
7999
- ⊛
80100
- ⊛
81101
- ✓ [#go-1.6-driver-support]_
@@ -91,6 +111,7 @@
91111
- ⊛
92112
- ⊛
93113
- ⊛
114+
- ⊛
94115
- ✓
95116
- ✓
96117
- ✓
@@ -103,6 +124,7 @@
103124
- ⊛
104125
- ⊛
105126
- ⊛
127+
- ⊛
106128
- ✓
107129
- ✓
108130
- ✓
@@ -116,6 +138,7 @@
116138
- ⊛
117139
- ⊛
118140
- ⊛
141+
- ⊛
119142
- ✓
120143
- ✓
121144
- ✓
@@ -128,6 +151,7 @@
128151
- ⊛
129152
- ⊛
130153
- ⊛
154+
- ⊛
131155
- ✓
132156
- ✓
133157
- ✓
@@ -140,6 +164,7 @@
140164
- ⊛
141165
- ⊛
142166
- ⊛
167+
- ⊛
143168
- ✓
144169
- ✓
145170
- ✓
@@ -153,6 +178,7 @@
153178
- ⊛
154179
- ⊛
155180
- ⊛
181+
- ⊛
156182
- ✓
157183
- ✓
158184
- ✓

source/whats-new.txt

+78-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
What's New
55
==========
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none
@@ -45,6 +43,84 @@ What's New in 1.12
4543
deprecated. You can create a client and connect in one call
4644
by using the ``mongo.Connect()`` method.
4745

46+
New features of the 1.12 Go driver release include:
47+
48+
Queryable Encryption
49+
~~~~~~~~~~~~~~~~~~~~
50+
51+
This driver version adds support for :ref:`qe-manual-feature-qe` (QE). To learn
52+
more about the requirements for using the QE feature, see the
53+
:ref:`Queryable Encryption Driver Compatibility Table
54+
<qe-compatibility-reference>`.
55+
56+
The ``ClientEncryption.CreateEncryptedCollection()``
57+
method automatically creates data encryption keys when
58+
you create a new encrypted collection. To learn how to use the QE
59+
feature, see the :ref:`qe-quick-start` in the Server manual.
60+
61+
Logging Interface
62+
~~~~~~~~~~~~~~~~~
63+
64+
You can now record connection management and command execution events by
65+
using the ``LogSink`` logging interface.
66+
67+
The ``LogSink`` interface is
68+
compatible with the `logr.LogSink <https://pkg.go.dev/github.com/go-logr/logr#LogSink>`__ interface.
69+
You can use existing ``logr`` adapters with the logging interface
70+
such as :github:`zerologr <go-logr/zerologr>` or :github:`zapr <go-logr/zapr>`.
71+
72+
Alternatively, you can implement your own ``LogSink`` adapter. The following
73+
example shows how to implement logging with an existing :github:`zerolog
74+
<rs/zerolog>` logger, called ``myLogger``:
75+
76+
.. code-block:: go
77+
78+
sink := zerologr.New(&myLogger).GetSink()
79+
loggerOptions := options.Logger().SetSink(sink)
80+
options.Client().SetLoggerOptions(loggerOptions)
81+
82+
Additional BSON Marshalling Options
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+
85+
This driver version adds features to the ``options`` package to specify
86+
how the driver marshals and unmarshals BSON.
87+
88+
The following example shows how to set BSON options on your
89+
``Client``. The options specify the following behaviors:
90+
91+
- The driver falls back to ``json`` :ref:`struct tags
92+
<golang-struct-tags>` if ``bson`` struct tags are absent.
93+
- The driver marshals ``nil`` Go map types as empty BSON documents.
94+
- The driver marshals ``nil`` Go slice types as empty BSON arrays.
95+
96+
.. code-block:: go
97+
98+
bsonOpts := &options.BSONOptions{
99+
UseJSONStructTags: true,
100+
NilMapAsEmpty: true,
101+
NilSliceAsEmpty: true,
102+
}
103+
options.Client().SetBSONOptions(bsonOpts)
104+
105+
For a full example of how to specify and implement the ``BSONOptions``
106+
type, see the `API documentation <{+api+}/mongo#example-Connect-BSONOptions>`__.
107+
108+
Simplified Write Concern Specification
109+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110+
111+
This driver version simplifies the ``WriteConcern`` API. To learn more about
112+
the changes, see :ref:`Write Concern <golang-writeconcern>`.
113+
114+
Additional Changes
115+
~~~~~~~~~~~~~~~~~~
116+
117+
- Support for authentication with AWS IAM roles in EKS.
118+
- Addition of the ``Cursor.SetBatchSize()`` method to allow
119+
specification of the size of batches fetched when iterating through a
120+
cursor.
121+
- Addition of the ``UnmarshalValue()`` method to allow ummarshalling of
122+
BSON values marshalled with the ``MarshalValue()`` method.
123+
48124
.. _version-1.11.0:
49125
.. _version-1.11:
50126

0 commit comments

Comments
 (0)