How to update each record in a collection in bulk?

I have 300+ items that each have an item_type field.

I have 300+ posts that have an existing item_id field and need an item_type field populated.

I'd like to set each post's item_type based on the item_type of the item referenced by the post.

How can I do that?

1 reply