code: function remove_field(aggr, name) {
      function _extract_date_histogram() {
          var names = aggr.grouping;
          var ptr = aggr.es_aggr;
          for (var i = 0; i < names.length; i++) {
              ptr = ptr[names[i]].aggregations;
          }
  
          return ptr;
      }
  
      var empty_fields = aggr.empty_fields.slice(0);
      empty_fields.push(name);
      var grouping = _.without(aggr.grouping, name);
      var new_es_aggr = make_bucket_agg(grouping, _extract_date_histogram());
  
      return {
          es_aggr: new_es_aggr,
          empty_result: aggr.empty_result,
          aggr_names: aggr.aggr_names,
          grouping: grouping,
          count: aggr.count,
          empty_fields: empty_fields
      };
  }
docs: utility to help with the case when we group by a non-existent field. given a grouped aggregation `aggr`, remove the field `name` from the grouping but store it in a list of empty_fields.  we will insert a point with the value null for each of these empty fields in points_from_es_aggr_resp() below.  see query.js for details of how this is used.