Skip to content

Commit e07220b

Browse files
committed
cleanup
1 parent c395217 commit e07220b

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

source/crud/update.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ The following shows the updated document resulting from the preceding update ope
204204
...
205205
}
206206

207-
Update a Document Example: Full File
208-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207+
UpdateOne() Example: Full File
208+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209209

210210
.. include:: /includes/usage-examples/example-intro.rst
211211

@@ -251,8 +251,8 @@ existing document in the ``restaurants`` collection. Select the
251251

252252
Documents updated: 1
253253

254-
Update Multiple Documents Example: Full File
255-
--------------------------------------------
254+
UpdateMany() Example: Full File
255+
-------------------------------
256256

257257
.. include:: /includes/usage-examples/example-intro.rst
258258

source/includes/usage-examples/code-snippets/updateManyBson.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,19 @@ func main() {
3333
}
3434
}()
3535

36-
// begin updatemany
3736
coll := client.Database("sample_restaurants").Collection("restaurants")
3837
filter := bson.D{{"cuisine", "Pizza"}, {"borough", "Brooklyn"}}
3938

40-
// Creates instructions to update the values of the "average rating" field
39+
// Creates instructions to update the values of the "avg_rating" field
4140
update := bson.D{{"$set", bson.D{{"avg_rating", 4.5}}}}
4241

43-
// Updates documents in which the value of the "address.market"
44-
// field is "Sydney"
42+
// Updates documents in which the value of the "cuisine" field is "Pizza"
43+
// and the value of the "borough" field is "Brooklyn"
4544
result, err := coll.UpdateMany(context.TODO(), filter, update)
4645
if err != nil {
4746
panic(err)
4847
}
4948

5049
// Prints the number of updated documents
5150
fmt.Printf("Documents updated: %v\n", result.ModifiedCount)
52-
// end updatemany
5351
}

0 commit comments

Comments
 (0)