Skip to content
Snippets Groups Projects
Commit 844d2035 authored by Cam Saul's avatar Cam Saul
Browse files

implementation of table columns that won't explode in large collections

parent f6b8c56d
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,10 @@
[table]
(with-mongo-connection [^com.mongodb.DBApiLayer conn @(:db table)]
(->> (mc/find-maps conn (:name table))
(r/map keys)
(r/map set)
(r/reduce set/union))))
(take 10000) ; it's probably enough to only consider the first 10,000 docs in the collection instead of iterating over potentially millions of them
(map keys)
(map set)
(reduce set/union))))
(defn- field->base-type
"Determine the base type of FIELD in the most ghetto way possible, via `values->base-type`."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment