 (defn- strip-id [data]
   (map #(dissoc % :_id) data))
 
+(defrecord QueryResult [total size data])
+
 (defn get-find
-  "Given a collection and a Mongo find map, return a map of the form:
+  "Given a collection and a Mongo find map, return a QueryResult of the form:
    :total - Total number of documents for the input query irrespective of skip or limit
    :size - Number of documents for the input query after skip and limit are applied
    :data - Seq of maps with the IDs stripped out"

  (log/info (str "Mongo aggregation: " aggregation))
  (let [data (strip-id (coll/aggregate collection aggregation))
        size (count data)]
    {:total size
     :size size
     :data 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
