I'm trying to update a certain attribute of all of my products programmatically. So far, I've used
Magento\Catalog\Model\ResourceModel\Product\CollectionFactory and iterating through the products, setting data and using
save() on each product. This was successful, but just for the primary store view (ID 1) but not globally or for any of the three other multistore views.
I've tried calling
$product->setStoreId(0) on each product, but this doesn't work.
What's the best way to programmatically update an attribute for all views?