def _rename_fields(cls, sample_collection, paths, new_paths):
        """Renames the fields of the documents in this collection.

        Args:
            sample_collection: the
                :class:`fiftyone.core.samples.SampleCollection`
            paths: an iterable of field names or ``embedded.field.names``
            new_paths: an iterable of new field names or
                ``embedded.field.names``
        """
        dataset = cls._dataset
        dataset_doc = dataset._doc
        media_type = dataset.media_type
        is_frame_field = cls._is_frames_doc
        is_dataset = isinstance(sample_collection, fod.Dataset)
        new_group_field = None

        simple_paths = []
        coll_paths = []
        schema_paths = []

        for path, new_path in zip(paths, new_paths):
            is_root_field = "." not in path
            field, is_default = cls._get_field(
                path, allow_missing=True, check_default=True
            )
            existing_field = cls._get_field(new_path, allow_missing=True)

            if field is None and is_root_field:
                raise AttributeError(
                    "%s field '%s' does not exist" % (cls._doc_name(), path)
                )

            if is_default:
                raise ValueError(
                    "Cannot rename default %s field '%s'"
                    % (cls._doc_name().lower(), path)
                )

            if field is not None and getattr(field, "read_only", False):
                raise ValueError(
                    "Cannot rename read-only %s field '%s'"
                    % (cls._doc_name().lower(), path)
                )

            if existing_field is not None:
                raise ValueError(
                    "%s field '%s' already exists"
                    % (cls._doc_name(), new_path)
                )

            validate_field_name(
                new_path,
                media_type=media_type,
                is_frame_field=is_frame_field,
            )

            if fog.is_group_field(field):
                if "." in new_path:
                    raise ValueError(
                        "Invalid group field '%s'; group fields must be "
                        "top-level fields" % new_path
                    )

                new_group_field = new_path

            if is_dataset and is_root_field:
                simple_paths.append((path, new_path))
            else:
                coll_paths.append((path, new_path))

            if field is not None:
                schema_paths.append((path, new_path))

        if simple_paths:
            _paths, _new_paths = zip(*simple_paths)
            cls._rename_fields_simple(_paths, _new_paths)

        if coll_paths:
            _paths, _new_paths = zip(*coll_paths)
            cls._rename_fields_collection(
                sample_collection, _paths, _new_paths
            )

        # This fixes https://github.com/voxel51/fiftyone/issues/3185
        # @todo improve list field updates in general so this isn't necessary
        if schema_paths:
            cls._reload_fields()

        for path, new_path in schema_paths:
            cls._rename_field_schema(path, new_path)

        if new_group_field:
            dataset_doc.group_field = new_group_field

        if is_frame_field:
            paths = [dataset._FRAMES_PREFIX + p for p in paths]
            new_paths = [dataset._FRAMES_PREFIX + p for p in new_paths]

        dataset_doc.app_config._rename_paths(paths, new_paths)
        dataset_doc.save()

        if schema_paths:
            cls._rename_indexes(paths, new_paths)
Renames the fields of the documents in this collection.

        Args:
            sample_collection: the
                :class:`fiftyone.core.samples.SampleCollection`
            paths: an iterable of field names or ``embedded.field.names``
            new_paths: an iterable of new field names or
                ``embedded.field.names``
        
fiftyone/core/odm/mixins.py