mergeFields property

List<FieldPath>? get mergeFields

The fields to merge, or null to merge every field of the data (with merge) or to replace the document.

Throws an ArgumentError if an entry is not a String or a FieldPath, or is not a valid field path.

Implementation

List<FieldPath>? get mergeFields {
  final List<Object>? fields = _mergeFields;
  if (fields == null) {
    return null;
  }
  return List<FieldPath>.unmodifiable(<FieldPath>[
    for (final Object field in fields)
      if (field is FieldPath)
        field
      else if (field is String)
        FieldPath.fromString(field)
      else
        throw ArgumentError.value(
          field,
          'mergeFields',
          'must contain String or FieldPath values',
        ),
  ]);
}