Make monger.core/get-db-names return a set
This commit is contained in:
parent
7348ca9f2e
commit
7747325030
2 changed files with 4 additions and 6 deletions
|
|
@ -52,14 +52,14 @@
|
|||
([{ :keys [host port] :or { host *mongodb-host*, port *mongodb-port* }}]
|
||||
(Mongo. ^String host ^Long port)))
|
||||
|
||||
|
||||
|
||||
|
||||
(defn ^DB get-db-names
|
||||
"Gets a list of all database names present on the server"
|
||||
([]
|
||||
(list (.getDatabaseNames *mongodb-connection*)))
|
||||
(get-db-names *mongodb-connection*))
|
||||
([^Mongo connection]
|
||||
(list (.getDatabaseNames connection))))
|
||||
(set (.getDatabaseNames connection))))
|
||||
|
||||
|
||||
(defn ^DB get-db
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@
|
|||
(deftest test-get-db-names
|
||||
(let [dbs (monger.core/get-db-names)]
|
||||
(is (not (empty? dbs)))
|
||||
(is (some #{"monger-test"} dbs))
|
||||
)
|
||||
)
|
||||
(is (dbs "monger-test"))))
|
||||
|
||||
;; (deftest get-database-with-valid-credentials
|
||||
;; (let [connection (monger.core/connect)
|
||||
|
|
|
|||
Loading…
Reference in a new issue