code: function aggregateParams(_, pulse) {
    var key    = _.field,
    value  = _.value,
        op     = (_.op === 'count' ? '__count__' : _.op) || 'sum',
        fields = accessorFields(key).concat(accessorFields(value)),
        keys   = pivotKeys(key, _.limit || 0, pulse);
  
    return {
      key:      _.key,
      groupby:  _.groupby,
      ops:      keys.map(function() { return op; }),
      fields:   keys.map(function(k) { return get(k, key, value, fields); }),
      as:       keys.map(function(k) { return k + ''; }),
      modified: _.modified.bind(_)
    };
  }
docs: Shoehorn a pivot transform into an aggregate transform! First collect all unique pivot field values. Then generate aggregate fields for each output pivot field.