Can I update a pivot Transform's aggregation script?

I have a transform with a scripted metric aggregation. I need to change how some fields are being calculated and I need to drop a few fields. However, the update API doesn't appear to support updating the transform's aggregation. What's the recommendation for updating the aggregation on a transform? Thanks!

The pivot part can't be updated. The technical reason for this is the generation of the document id and therefore the ability to update a bucket. We want to avoid unexpected results and duplicates for the user.

In your case however you can create a transform and reference stored scripts instead of putting the scripts inline. That way you can change the script later.

Thanks. That makes sense and the stored scripts approach sounds perfect!