updateFields method

DocumentUpdate<D> updateFields(
  1. Map fieldMap
)

Implementation

DocumentUpdate<D> updateFields(Map fieldMap) {
  fieldMap.entries.where((entry) => entry.value != null).forEach((entry) {
    final tag = _document.getTagNumber(entry.key)!;
    try {
      _document.setField(tag, entry.value);
    } catch (e) {
      _document.getField(tag).addAll(entry.value);
    }

    final normalizedPath = ReCase(entry.key).snakeCase;
    _mask.paths.add(normalizedPath);
  });
  return this;
}