Ditto for monger.collection/drop
This commit is contained in:
parent
dccb4770f1
commit
76a3eafd5d
1 changed files with 8 additions and 5 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue