Merge pull request #45 from huangz1990/master
Remove duplicated create function in monger.collection
This commit is contained in:
commit
7ed7e8ae0d
1 changed files with 13 additions and 11 deletions
|
|
@ -606,7 +606,19 @@
|
||||||
(.collectionExists db collection)))
|
(.collectionExists db collection)))
|
||||||
|
|
||||||
(defn create
|
(defn create
|
||||||
"Creates a collection with a given name and options."
|
"Creates a collection with a given name and options.
|
||||||
|
|
||||||
|
Options are:
|
||||||
|
|
||||||
|
:capped (pass true to create a capped collection)
|
||||||
|
:max (number of documents)
|
||||||
|
:size (max allowed size of the collection, in bytes)
|
||||||
|
|
||||||
|
EXAMPLE:
|
||||||
|
|
||||||
|
;; create a capped collection
|
||||||
|
(monger.collection/create \"coll\" {:capped true :size 100000 :max 10})
|
||||||
|
"
|
||||||
([^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)))
|
||||||
([^DB db ^String collection ^Map options]
|
([^DB db ^String collection ^Map options]
|
||||||
|
|
@ -666,16 +678,6 @@
|
||||||
(.distinct (.getCollection db (name collection)) ^String (to-db-object key) (to-db-object query))))
|
(.distinct (.getCollection db (name collection)) ^String (to-db-object key) (to-db-object query))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; create/capped collections
|
|
||||||
;;
|
|
||||||
|
|
||||||
(defn create
|
|
||||||
"Creates a collection. Options are: :capped (pass true to create a capped collection), :max (number of documents)
|
|
||||||
and :size (max allowed size of the collection, in bytes)."
|
|
||||||
[^String collection options]
|
|
||||||
(.createCollection ^DB monger.core/*mongodb-database* collection (to-db-object options)))
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Aggregation
|
;; Aggregation
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue