From 8deba612bb6ff05aabae0e8d52cbc6e7f7a9c453 Mon Sep 17 00:00:00 2001 From: Chris Broome Date: Thu, 1 Dec 2022 21:59:06 -0500 Subject: [PATCH] Allow keywords as collection names in rename and aggreate --- src/clojure/monger/collection.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clojure/monger/collection.clj b/src/clojure/monger/collection.clj index c6763bc..97b5d25 100644 --- a/src/clojure/monger/collection.clj +++ b/src/clojure/monger/collection.clj @@ -490,9 +490,9 @@ (defn rename "Renames collection." ([^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?] - (.rename (.getCollection db from) to drop-target?))) + (.rename (.getCollection db (name from)) (name to) drop-target?))) ;; ;; Map/Reduce @@ -545,7 +545,7 @@ See http://docs.mongodb.org/manual/applications/aggregation/ to learn more." [^DB db ^String coll stages & opts] - (let [coll (.getCollection db coll) + (let [coll (.getCollection db (name coll)) agg-opts (build-aggregation-options opts) pipe (into-array-list (to-db-object stages)) res (.aggregate coll pipe agg-opts) @@ -558,7 +558,7 @@ See http://docs.mongodb.org/manual/applications/aggregation/ to learn more." [^DB db ^String coll stages & opts] - (let [coll (.getCollection db coll) + (let [coll (.getCollection db (name coll)) agg-opts (build-aggregation-options opts) pipe (into-array-list (to-db-object stages)) res (.explainAggregate coll pipe agg-opts)]