From ce6dcd27cbaddec18d316fde0e370c37634fe6db Mon Sep 17 00:00:00 2001 From: Timo Geusch Date: Wed, 24 Apr 2019 14:06:16 -0700 Subject: [PATCH] Added test case for distinct to exercise non-query distinct API The existing test cases only covered the form (distinct ... :field {query}). This chance adds a test for the non-query form also. --- test/monger/test/collection_test.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/monger/test/collection_test.clj b/test/monger/test/collection_test.clj index ad79fda..662865b 100644 --- a/test/monger/test/collection_test.clj +++ b/test/monger/test/collection_test.clj @@ -134,6 +134,7 @@ {:state "CA" :quantity 2 :price 2.95 } {:state "IL" :quantity 3 :price 5.50 }]] (mc/insert-batch db collection batch) + (is (= ["CA" "IL" "NY"] (sort (mc/distinct db collection :state)))) (is (= ["CA" "IL" "NY"] (sort (mc/distinct db collection :state {})))) (is (= ["CA" "NY"] (sort (mc/distinct db collection :state {:price {$gt 100.00}}))))))