   (log/info (str "Mongo aggregation: " aggregation))
   (let [data (strip-id (coll/aggregate collection aggregation))
         size (count data)]
-    {:total size
-     :size size
-     :data data}))
+    (->QueryResult size size data)))
 
 (defn get-data-table
   "Given retrieved data (a seq of maps) and the columns you want from


(defn disconnect-mongo []
  (mongo/disconnect!))

(defn get-datasets
  "Get metadata for all datasets. Information about the datasets is

    (.limit (:limit find-map))
    (.skip (:skip find-map))
    (.sort (conv/to-db-object (:sort find-map))))]
    (->QueryResult
      (.count cursor)
      (.size cursor)
      (strip-id (map (fn [x] (conv/from-db-object x true)) cursor)))))

(defn get-aggregation
  "Given a collection and a Mongo aggregation, return a QueryResult of the form:
   :total - Total number of results returned
   :size - Same as :total
   :data - Seq of maps with the IDs stripped out"
