Update field setting value using getFieldByHandle
MY SOLUTION

Use setAttributes and set the second argument $safeOnly to false

$fieldsService = Craft::$app-&gt;getFields();
$field = $fieldsService-&gt;getFieldByHandle('productImages');
// Update 'limit' value to be empty in order to accept as many images as needed
$field-&gt;setAttributes([
    'limit' =&gt; ''
],false);
$fieldsService-&gt;saveField($field);