                                            "Message 8" "Message 9"]]
                             [>= :created_at (-> (date-time 2014 11 17 23 6)
                                                 .toDate
-                                                query/min-timeuuid)]
+                                                min-timeuuid)]
                             [<= :created_at (-> (date-time 2014 11 17 23 8)
                                                 .toDate
-                                                query/max-timeuuid)]]))]
+                                                max-timeuuid)]]))]
     (is (= #{"Message 6" "Message 7" "Message 8"}
            (set (map :message xs))))))
 

(deftest test-counter-2
  (dotimes [i 100]
    (update *session* :user_counters
            {:user_count (query/increment)}
            (where {:name "user1"})))
  (is (= 100 (-> (select *session* :user_counters)
                 first

  (let [dt (-> 2 seconds ago)]
    (dotimes [i 20]
      (insert *session* :events
              {:created_at (now)
               :message (format "Message %d" i)}))
    (let [xs  (select *session* :events
                      (date-of :created_at)
                      (limit 5))
          dt' (cc/from-date (get (first xs) (keyword "dateOf(created_at)")))]
      (is (before? dt dt')))))
