 (ns cadence.model
   (:refer-clojure :exclude [identity])
-  (:require [monger.core :as mg]
-            [monger.collection :as mc]
-            [monger.query :as mq]
+  (:require (monger [core :as mg]
+                    [collection :as mc]
+                    [query :as mq]
+                    [operators :refer :all])
             [noir.validation :as vali]
             [cadence.pattern-recognition :as patrec]
-            [noir.options :as options]
-            [cemerick.friend :as friend])
-  (:use clojure.walk
-        monger.operators
-        [cemerick.friend.credentials :only [hash-bcrypt]])
+            [clojure.walk :refer :all]
+            [cemerick.friend :as friend]
+            [cemerick.friend.credentials :refer [hash-bcrypt]])
   (:import [org.bson.types ObjectId]))
 
 ;; This namespace contains all functions related to manipulating the

                      $inc {:usersCount -1}})
    ;; Remove related cadences
    (mc/remove "cadences" {:phrase_id phrase-oid
                           :user_id user-oid}))
  )

(defn store-classifier
  "Stores the given classifier with the given user/phrase pair."

                       {$set {:random_point [(rand) 0]}}))
    result))

(defn get-phrase-for-auth [user-id]
  "Get a random phrase for user authentication."
  (get-phrase {:users user-id :usersCount {$gt 5}}))

(defn get-phrase-for-training [user-id]
  "Get a random phrase for user training."
  (get-phrase {:users {$ne user-id}}))


(defn get-training-data
  "Returns cadences to be used to train a classifier as a tuple of bad cadences
  and good cadences."
