//update definitions
var filterDefinition = Builders<User>.Filter.Eq(p => p.isBlocked, false);
var updateDefinition = Builders<User>.Update.Set(p => p.isBlocked, true);
public static async Task BulkUpdateManyMongoDb()
{
IMongoDatabase db = _client.GetDatabase("sample_blog");
var userCollection = db.GetCollection<User>("users");
var listWrites = new List<WriteModel<User>>();
var filterDefinition = Builders<User>.Filter.Eq(p => p.isBlocked, false);
var updateDefinition = Builders<User>.Update.Set(p => p.isBlocked, true);
listWrites.Add(new UpdateManyModel<User>(filterDefinition, updateDefinition));
await userCollection.BulkWriteAsync(listWrites);
}