@@ -88,8 +88,8 @@ Example
8888
8989The following example performs the following actions:
9090
91- - Matches documents where the ``species`` is "Ledebouria socialis" and
92- the ``plant_id`` is ``3``
91+ - Matches documents where the ``species`` is `` "Ledebouria socialis"``
92+ and the ``plant_id`` is ``3``
9393- Updates the ``height`` of the matched document to ``8.3``
9494- Inserts this document if there are no matches to the query filter
9595
@@ -101,7 +101,7 @@ The following example performs the following actions:
101101
102102 filter := bson.D{{"species", "Ledebouria socialis"}, {"plant_id", 3}}
103103 update := bson.D{{"$set", bson.D{{"species", "Ledebouria socialis"}, {"plant_id", 3}, {"height", 8.3}}}}
104- opts := options.Update ().SetUpsert(true)
104+ options.UpdateOne ().SetUpsert(true)
105105
106106 result, err := coll.UpdateOne(context.TODO(), filter, update, opts)
107107 if err != nil {
@@ -152,6 +152,6 @@ guide, see the following API Documentation:
152152- `ReplaceOne() <{+api+}/mongo#Collection.ReplaceOne>`__
153153- `FindOneAndUpdate() <{+api+}/mongo#Collection.FindOneAndUpdate>`__
154154- `FindOneAndReplace() <{+api+}/mongo#Collection.FindOneAndReplace>`__
155- - `UpdateOptions .SetUpsert() <{+api+}/mongo/options#UpdateOptions .SetUpsert>`__
156- - `ReplaceOptions .SetUpsert() <{+api+}/mongo/options#ReplaceOptions .SetUpsert>`__
155+ - `UpdateOneOptionsBuilder .SetUpsert() <{+api+}/mongo/options#UpdateOneOptionsBuilder .SetUpsert>`__
156+ - `ReplaceOptionsBuilder .SetUpsert() <{+api+}/mongo/options#ReplaceOptionsBuilder .SetUpsert>`__
157157- `UpdateResult <{+api+}/mongo#UpdateResult>`__
0 commit comments