Skip to content

Commit 45daef8

Browse files
committed
update bulk ops
1 parent 375586e commit 45daef8

File tree

1 file changed

+3
-3
lines changed
  • source/includes/usage-examples/code-snippets

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ func main() {
4848
// Creates write models that specify replace and update operations
4949
models := []mongo.WriteModel{
5050
mongo.NewReplaceOneModel().SetFilter(bson.D{{"name", "Towne Cafe"}}).
51-
SetReplacement(Restaurant{Name: "New Towne Cafe"}),
52-
mongo.NewUpdateOneModel().SetFilter(bson.D{{"name", "New Towne Cafe"}}).
53-
SetUpdate(bson.D{{"$set", bson.D{{"cuisine", "French"}}}}),
51+
SetReplacement(Restaurant{Name: "New Towne Cafe", Cuisine: "French"}),
52+
mongo.NewUpdateOneModel().SetFilter(bson.D{{"name", "Riviera Caterer"}}).
53+
SetUpdate(bson.D{{"$set", bson.D{{"name", "Riviera Cafe"}}}}),
5454
}
5555

5656
// Specifies that the bulk write is ordered

0 commit comments

Comments
 (0)