updateAllForField method
Updates a specific field for all documents that match the given filter
.
The field
specifies the field to be updated, and value
is the new value
to be assigned. The filter
map is used to specify the matching condition.
Implementation
Future<void> updateAllForField({
required String field,
required Object? value,
required Map<String, Object?>? filter,
}) async {
await collection.updateMany(
filter,
modify.set(field, value),
);
}