Skip to content

Instantly share code, notes, and snippets.

Created October 20, 2012 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3921746 to your computer and use it in GitHub Desktop.
Save anonymous/3921746 to your computer and use it in GitHub Desktop.
(defn edit-user! [{:keys [username old-name password]}]
(let [user {:username username :password password}]
(if (= username old-name)
(when (valid-psw? password)
(let [{uname :username}]
(-> user (repo/upsert :users) )))))) ;calling function
(defn upsert ([model condition document-fields
& {:keys [upsert] :or {upsert false}}]
(mc/update model condition document-fields upsert))
([model document-fields & {:keys [upsert] :or {upsert false}}]
mc/update document-fields upsert))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment