Created
December 14, 2011 13:58
-
-
Save masaedw/1476653 to your computer and use it in GitHub Desktop.
heroku等でURI形式でmongodbの接続先が提供される場合にdbを作る
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn database-from-uri [uri] | |
| (let [uri (com.mongodb.MongoURI. uri)] | |
| (doto (.connectDB uri) | |
| (.authenticate (.getUsername uri) | |
| (.getPassword uri))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment