title: Knockout: How to update single field in each of ko.mapping array elements
body: <p>I have a large observable array:</p>
  
  <pre><code>self.data = ko.mapping.fromJS(bigdata)
  </code></pre>
  
  <p>I need to update a single field of each element in data;</p>
  
  <p>The simpliest solution is</p>
  
  <pre><code>self.showAll = function() {
      for(var i = 0; i&lt;self.data().length; i++) {
          self.data()[i].visible(true);
      }
  }
  </code></pre>
  
  <p>But it is very slow, because it calls handlers after each update. Recommended to use code like this:</p>
  
  <pre><code>var items = ko.observableArray([]);
  var underlyingArray = items();
  for (var i = 0, j = underlyingArray.length; i &lt; j; i++) {
      // work with underlyingArray
  }
  self.items.valueHasMutated();
  </code></pre>
  
  <p>But it doesn't work with ko.mapping objects.</p>
  
  <p>Now I'm using code like</p>
  
  <pre><code>var data = ko.mapping.toJS(self.data);
  for(var i = 0; i&lt;data.length; i++) {
    //
  }
  ko.mapping.fromJS(data, {}, self.data);
  </code></pre>
  
  <p>I dont like it. Maybe there's something better? Is there a way to suspend all ko handlers?</p>