Ditto for monger.collection/drop

This commit is contained in:
Michael S. Klishin 2012-01-29 07:29:30 +04:00
parent dccb4770f1
commit 76a3eafd5d

View file

@ -414,8 +414,8 @@
(defn create (defn create
"Creates a collection with a given name and options." "Creates a collection with a given name and options."
[^String collection, ^Map options] ([^String collection ^Map options]
(.createCollection monger.core/*mongodb-database* collection (to-db-object options))) (.createCollection monger.core/*mongodb-database* collection (to-db-object options))))
(defn drop (defn drop
"Deletes collection from database. "Deletes collection from database.
@ -424,9 +424,12 @@
(monger.collection/drop \"collection-to-drop\") (monger.collection/drop \"collection-to-drop\")
" "
[^String collection] ([^String collection]
(let [^DBCollection coll (.getCollection monger.core/*mongodb-database* collection)] (let [^DBCollection coll (.getCollection monger.core/*mongodb-database* collection)]
(.drop coll))) (.drop coll)))
([^DB db ^String collection]
(let [^DBCollection coll (.getCollection db collection)]
(.drop coll))))
(defn rename (defn rename
"Renames collection. "Renames collection.