From f1fff715772765d003986891b2cf66633dc9249f Mon Sep 17 00:00:00 2001 From: Andrei Biasprozvanny Date: Tue, 25 Aug 2015 16:16:29 +0100 Subject: [PATCH 1/3] Add IntelliJ files to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 6e499e06..1a970a9a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ deploy.docs.sh target/* todo.org .nrepl-* +.idea/ +*.iml From ebc01b3f543a6c049f54d33deedc322b071b7d72 Mon Sep 17 00:00:00 2001 From: Andrei Biasprozvanny Date: Tue, 25 Aug 2015 16:48:17 +0100 Subject: [PATCH 2/3] Find-maps now supports keywordize option --- src/clojure/monger/collection.clj | 4 +++- test/monger/test/regular_finders_test.clj | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/clojure/monger/collection.clj b/src/clojure/monger/collection.clj index a4cd2309..f9c3c9c9 100644 --- a/src/clojure/monger/collection.clj +++ b/src/clojure/monger/collection.clj @@ -147,8 +147,10 @@ (with-open [dbc (find db coll ref)] (map (fn [x] (from-db-object x true)) dbc))) ([^DB db ^String coll ^Map ref fields] + (find-maps db coll ref fields true)) + ([^DB db ^String coll ^Map ref fields keywordize] (with-open [dbc (find db coll ref fields)] - (map (fn [x] (from-db-object x true)) dbc)))) + (map (fn [x] (from-db-object x keywordize)) dbc)))) (defn find-seq "Queries for objects in this collection, returns ISeq of DBObjects." diff --git a/test/monger/test/regular_finders_test.clj b/test/monger/test/regular_finders_test.clj index bf7e6a07..7785f2c7 100644 --- a/test/monger/test/regular_finders_test.clj +++ b/test/monger/test/regular_finders_test.clj @@ -281,4 +281,12 @@ (doseq [i clojure-libs] (let [doc (mgcnv/from-db-object i true)] (is (= (:language doc) "Clojure")))) - (is (empty? (mc/find db collection { :language "Erlang" } [:name]))))))) + (is (empty? (mc/find db collection { :language "Erlang" } [:name])))))) + + (deftest find-maps-with-keywordize-false + (let [collection "libraries"] + (mc/insert-batch db collection [{ :language "Clojure", :name "monger" } + { :language "Clojure", :name "langohr" }]) + (let [results (mc/find-maps db collection {:name "langohr"} [] false)] + (is (= 1 (.count results))) + (is (= (get (first results) "language") "Clojure")))))) From ee0c3dbedee0acf67d2e719f3215ef0780742473 Mon Sep 17 00:00:00 2001 From: Andrei Biasprozvanny Date: Tue, 25 Aug 2015 16:50:35 +0100 Subject: [PATCH 3/3] Updated Readme to include before-script.sh when running the tests --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d237fba1..ed49440f 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,8 @@ Monger is part of the [group of Clojure libraries known as ClojureWerkz](http:// Monger uses [Leiningen 2](https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md). Make sure you have it installed and then run tests against supported Clojure versions using - + + ./bin/ci/before_script.sh lein all do clean, javac, test Then create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request