This commit is contained in:
Bartek Marcinowski 2015-06-23 17:03:12 +00:00
commit 9a9e2bbf82

View file

@ -523,8 +523,8 @@
"Executes an aggregation query. MongoDB 2.2+ only.
See http://docs.mongodb.org/manual/applications/aggregation/ to learn more."
[^DB db ^String coll stages]
(let [res (mc/command db {:aggregate coll :pipeline stages})]
[^DB db ^String coll stages & [^Boolean allow-disk-use]]
(let [res (mc/command db {:aggregate coll :pipeline stages :allowDiskUse (boolean allow-disk-use)})]
;; this is what DBCollection#distinct does. Turning a blind's eye!
(.throwOnError res)
(map #(from-db-object % true) (.get res "result"))))