Allow keywords as collection names in rename and aggreate
This commit is contained in:
parent
74a13a3489
commit
8deba612bb
1 changed files with 4 additions and 4 deletions
|
|
@ -490,9 +490,9 @@
|
||||||
(defn rename
|
(defn rename
|
||||||
"Renames collection."
|
"Renames collection."
|
||||||
([^DB db ^String from, ^String to]
|
([^DB db ^String from, ^String to]
|
||||||
(.rename (.getCollection db from) to))
|
(.rename (.getCollection db (name from)) (name to)))
|
||||||
([^DB db ^String from ^String to drop-target?]
|
([^DB db ^String from ^String to drop-target?]
|
||||||
(.rename (.getCollection db from) to drop-target?)))
|
(.rename (.getCollection db (name from)) (name to) drop-target?)))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Map/Reduce
|
;; Map/Reduce
|
||||||
|
|
@ -545,7 +545,7 @@
|
||||||
|
|
||||||
See http://docs.mongodb.org/manual/applications/aggregation/ to learn more."
|
See http://docs.mongodb.org/manual/applications/aggregation/ to learn more."
|
||||||
[^DB db ^String coll stages & opts]
|
[^DB db ^String coll stages & opts]
|
||||||
(let [coll (.getCollection db coll)
|
(let [coll (.getCollection db (name coll))
|
||||||
agg-opts (build-aggregation-options opts)
|
agg-opts (build-aggregation-options opts)
|
||||||
pipe (into-array-list (to-db-object stages))
|
pipe (into-array-list (to-db-object stages))
|
||||||
res (.aggregate coll pipe agg-opts)
|
res (.aggregate coll pipe agg-opts)
|
||||||
|
|
@ -558,7 +558,7 @@
|
||||||
|
|
||||||
See http://docs.mongodb.org/manual/applications/aggregation/ to learn more."
|
See http://docs.mongodb.org/manual/applications/aggregation/ to learn more."
|
||||||
[^DB db ^String coll stages & opts]
|
[^DB db ^String coll stages & opts]
|
||||||
(let [coll (.getCollection db coll)
|
(let [coll (.getCollection db (name coll))
|
||||||
agg-opts (build-aggregation-options opts)
|
agg-opts (build-aggregation-options opts)
|
||||||
pipe (into-array-list (to-db-object stages))
|
pipe (into-array-list (to-db-object stages))
|
||||||
res (.explainAggregate coll pipe agg-opts)]
|
res (.explainAggregate coll pipe agg-opts)]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue