   (mq/with-collection EXERCISE 
     (mq/find query)
     (mq/sort {:creationDate 1})
-    (mq/batch-size 5000)))
+    (mq/batch-size 1000)))
 
 (defn csv-escape [field]
   (let [s (str field)]

(defn export [params]
  (.info logger (str "Exporting csv " params))
  (if-let [user (:user params)]
    (to-csv (exs (assoc ex-filter :user user)))
    ""))

                     get-pace
                     tags])))

(defn ex-filter [year user]
  {"$and" [{:creationDate {"$gte" (time/date-time year 1 1)}} {:creationDate {"$lt" (time/date-time (inc year) 1 1)}} {:user user}]})

(defn to-csv [exs] 
  (str
