File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/MongoDB.Driver.Examples Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -80,18 +80,19 @@ public async Task UpdateMultipleDocuments()
80
80
// @begin: update-multiple-documents
81
81
// @code: start
82
82
var collection = _database . GetCollection < BsonDocument > ( "restaurants" ) ;
83
- var filter = Builders < BsonDocument > . Filter . Eq ( "address.zipcode" , "10016" ) ;
83
+ var builder = Builders < BsonDocument > . Filter ;
84
+ var filter = builder . Eq ( "address.zipcode" , "10016" ) & builder . Eq ( "cuisine" , "Other" ) ;
84
85
var update = Builders < BsonDocument > . Update
85
- . Set ( "borough " , "Midtown " )
86
+ . Set ( "cuisine " , "Category To Be Determined " )
86
87
. CurrentDate ( "lastModified" ) ;
87
88
var result = await collection . UpdateManyAsync ( filter , update ) ;
88
89
// @code: end
89
90
90
91
// @results: start
91
- result . MatchedCount . Should ( ) . Be ( 433 ) ;
92
+ result . MatchedCount . Should ( ) . Be ( 20 ) ;
92
93
if ( result . IsModifiedCountAvailable )
93
94
{
94
- result . ModifiedCount . Should ( ) . Be ( 433 ) ;
95
+ result . ModifiedCount . Should ( ) . Be ( 20 ) ;
95
96
}
96
97
// @results: end
97
98
You can’t perform that action at this time.
0 commit comments