update method
Applies changes to the records where picks, and answers how many.
An optimistic write names the version it read in where; nought
changed is the conflict.
Implementation
@override
Future<int> update(
String collection,
Map<String, Object?> changes, {
required DVFilter where,
}) async {
DVSqlRecordAdapter._refuseEverything(where, 'update');
int changed = 0;
for (final Map<String, Object?> record in _in(collection)) {
if (where.matches(record)) {
record.addAll(changes);
changed++;
}
}
return changed;
}