def update_fields(
        self,
        fields_dict,
        expand_schema=True,
        validate=True,
        dynamic=False,
    ):
        """Sets the dictionary of fields on the document.

        Args:
            fields_dict: a dict mapping field names to values
            expand_schema (True): whether to dynamically add new fields
                encountered to the document schema. If False, an error is
                raised if any fields are not in the document schema
            validate (True): whether to validate values for existing fields
            dynamic (False): whether to declare dynamic embedded document
                fields

        Raises:
            AttributeError: if ``expand_schema == False`` and a field does not
                exist
        """
        for field_name, value in fields_dict.items():
            self.set_field(
                field_name,
                value,
                create=expand_schema,
                validate=validate,
                dynamic=dynamic,
            )
Sets the dictionary of fields on the document.

        Args:
            fields_dict: a dict mapping field names to values
            expand_schema (True): whether to dynamically add new fields
                encountered to the document schema. If False, an error is
                raised if any fields are not in the document schema
            validate (True): whether to validate values for existing fields
            dynamic (False): whether to declare dynamic embedded document
                fields

        Raises:
            AttributeError: if ``expand_schema == False`` and a field does not
                exist
        
fiftyone/core/document.py