 
 (let [make-fn (fn [aggs] (fn [query] (if-not aggs query (assoc query :aggs aggs))))]
   (def aggregations
-    {:es-count
+    {:count
      (make-fn nil)
   
      :paid-total-stats-by-time-of-day 

                                               (clojure.string/replace #"doc\['([^']+)'\]\.value" "$1")
                                               (clojure.string/replace #"([a-z])-([a-z])"         "$1_$2")))))
              
              gen-col-name 
              (fn [field name interval]
                (-> (format "%s_%s_%.1f" field name interval) (clojure.string/replace #"\." "")))
              
              this-agg  
              (if (group-by? agg-type)

                   
                   :histogram
                   (let [interval (-> agg-data :interval float)]
                     [{:agg (format "FLOOR(%s / %.1f)" field interval)
                       :col (gen-col-name field "hist" (:interval agg-data))}])
                   
                   :date_histogram
                   (let [_            (assert (= \d (-> agg-data :interval last)) "Only days are supported for now")
                         interval     (-> agg-data :interval butlast (#(Float. (apply str %))))
                         interval-div (if (= 1.0 interval) "" (format " / %.1f" interval))]
                     [{:agg (format "FLOOR(CAST(CAST(%s AS datetime) AS float)%s)" field interval-div)
                       :col (gen-col-name field "datehist" (:interval agg-data))}]))}
                
                {:metrics
                 (cond
