title: Update collection object using Underscore / Lo-dash
body: <p>I have two collections of objects. I iterate trough collection A and I want when ObjectId from A matches ObjectId from B, to update that Object in collection B.</p>
  
  <p>Here is what I got so far:</p>
  
  <pre><code>   var exerciseIds = _(queryItems).pluck('ExerciseId').uniq().valueOf();
          var item = { Exercise: null, ExerciseCategories: [] };
          var exerciseAndCategories = [];
  
          //this part works fine
          _.forEach(exerciseIds, function(id) {
              var temp = _.findWhere(queryItems, { 'ExerciseId': id });
              item.Exercise = temp.Exercise;
              exerciseAndCategories.push(item);
          });
  
          //this is problem
          _.forEach(queryItems, function (i) {
              _(exerciseAndCategories).where({ 'ExerciseId': i.ExerciseId }).tap(function (x) {
                  x.ExerciseCategories.push(i.ExerciseCategory);
              }).valueOf();
          });
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Link to a <a href="http://jsfiddle.net/B7vpg/2/" rel="nofollow">Fiddle</a></p>