def map(self, expr):
        """Applies the given expression to the elements of this expression,
        which must resolve to an array.

        The output will be an array with the applied results.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz
            from fiftyone import ViewField as F

            dataset = foz.load_zoo_dataset("quickstart")

            # Bboxes are in [top-left-x, top-left-y, width, height] format
            bbox_area = F("bounding_box")[2] * F("bounding_box")[3]

            # Only include predictions with `confidence` of at least 0.9
            view = dataset.set_field(
                "predictions.detections",
                F("detections").map(F().set_field("area", bbox_area))
            )

            print(view.bounds("predictions.detections.area"))

        Args:
            expr: a :class:`ViewExpression`

        Returns:
            a :class:`ViewExpression`
        """
        expr._freeze_prefix("$$this")
        return ViewExpression(
            {"$map": {"input": self, "as": "this", "in": expr}}
        )
Applies the given expression to the elements of this expression,
        which must resolve to an array.

        The output will be an array with the applied results.

        Examples::

            import fiftyone as fo
            import fiftyone.zoo as foz
            from fiftyone import ViewField as F

            dataset = foz.load_zoo_dataset("quickstart")

            # Bboxes are in [top-left-x, top-left-y, width, height] format
            bbox_area = F("bounding_box")[2] * F("bounding_box")[3]

            # Only include predictions with `confidence` of at least 0.9
            view = dataset.set_field(
                "predictions.detections",
                F("detections").map(F().set_field("area", bbox_area))
            )

            print(view.bounds("predictions.detections.area"))

        Args:
            expr: a :class:`ViewExpression`

        Returns:
            a :class:`ViewExpression`
        
fiftyone/core/expressions.py