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

Mongo QP handle distinct count limits

parent 4a6067b5
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,8 @@
(defaggregation ["distinct" field-id]
(aggregate {$group {"_id" (field-id->$string field-id)}}
(when-let [limit (:limit (:query *query*))]
{$limit limit})
{$group {"_id" nil
"count" {$sum 1}}}
{$project {"_id" false, "count" true}}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment