File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,24 @@ The 2.0 {+driver-short+} release includes the following improvements and fixes:
9292 contained the number of dropped indexes. See the
9393 :ref:`golang-remove-index` section of the Indexes guide to learn more.
9494
95+ - The driver no longer supports the ``mongo.ErrUnacknowledgedWrite`` sentinel
96+ error if a write operation is not acknowledged. To confirm that the server
97+ acknowledged a write operation, you must access the ``Acknowledged``
98+ property from the result struct returned by the write method.
99+
100+ The following example shows how to confirm acknowledgment of an insert
101+ operation:
102+
103+ .. code-block:: go
104+ :emphasize-lines: 6
105+
106+ res, err := coll.InsertOne(context.TODO(), bson.D{{"x", 2}})
107+ if err != nil {
108+ panic(err)
109+ }
110+
111+ fmt.Print(res.Acknowledged)
112+
95113- You can set options for transactions run in a given session by
96114 creating a ``TransactionOptions`` instance and passing the instance to
97115 the ``SetDefaultTransactionOptions()`` method of the
You can’t perform that action at this time.
0 commit comments