Replace cardinality-many attribute

As you’ve surmised, there is not a built-in function for “replace all targets” of a given many-cardinality attribute.

The general approach to solving this problem is to use a transaction function (or a tx-fn Ion if you’re using Cloud).

A related post (also on SO) presents an additional description and approach: https://stackoverflow.com/questions/42112557/datomic-schema-for-a-to-many-relationship-with-a-reset-operation