From 216674cd3d844814a44a789e76ee24bd13aaa42f Mon Sep 17 00:00:00 2001 From: Nico Date: Mon, 23 Jul 2018 14:34:48 +0200 Subject: [PATCH 01/24] Upgrade mongo drivers to 3.8.0 GA version I'm trying to upgrade with latest mongoDB drivers for Java. In case these drivers are breaking the tests I'll try with former `3.7.1` or `3.6.4` drivers version. --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 4c92739..c66a4b9 100644 --- a/project.clj +++ b/project.clj @@ -5,7 +5,7 @@ :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"] - [org.mongodb/mongodb-driver "3.6.0-beta2"] + [org.mongodb/mongodb-driver "3.8.0"] [clojurewerkz/support "1.1.0"]] :test-selectors {:default (fn [m] (and (not (:performance m)) From f6e5ff75ce886528c466410e1b30f287abbab21b Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Fri, 31 Aug 2018 17:48:25 -0700 Subject: [PATCH 02/24] Add $position Modifier for $push --- src/clojure/monger/operators.clj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/clojure/monger/operators.clj b/src/clojure/monger/operators.clj index ae4a828..6cb469c 100644 --- a/src/clojure/monger/operators.clj +++ b/src/clojure/monger/operators.clj @@ -184,6 +184,9 @@ ;; (mgcol/update "docs" { :_id oid } { $push { :tags "modifiers" } }) (defoperator $push) +;; $position modifies the behavior of $push per https://docs.mongodb.com/manual/reference/operator/update/position/ +(defoperator $position) + ;; $each is a modifier for the $push and $addToSet operators for appending multiple values to an array field. ;; Without the $each modifier $push and $addToSet will append an array as a single value. ;; MongoDB 2.4 adds support for the $each modifier to the $push operator. From ad2ee531a3e0192601d3c12b9eeea4aeab5ccf22 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:23:20 +0300 Subject: [PATCH 03/24] $pushAll is gone, replaced by $push + $each See https://docs.mongodb.com/v3.2/reference/operator/update/each/#up._S_each. --- src/clojure/monger/operators.clj | 8 -------- test/monger/test/atomic_modifiers_test.clj | 16 ++++++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/clojure/monger/operators.clj b/src/clojure/monger/operators.clj index 6cb469c..0b4a6a8 100644 --- a/src/clojure/monger/operators.clj +++ b/src/clojure/monger/operators.clj @@ -196,14 +196,6 @@ ;; (mgcol/update coll { :_id oid } { $push { :tags { $each ["mongodb" "docs"] } } }) (defoperator $each) -;; $pushAll appends each value in value_array to field, if field is an existing array, otherwise sets field to the array value_array -;; if field is not present. If field is present but is not an array, an error condition is raised. -;; Deprecated since MongoDB 2.4, $push with $each modifier should be used instead. -;; -;; EXAMPLES: -;; (mgcol/update coll { :_id oid } { $pushAll { :tags ["mongodb" "docs"] } }) -(defoperator $pushAll) - ;; $addToSet Adds value to the array only if its not in the array already, if field is an existing array, otherwise sets field to the ;; array value if field is not present. If field is present but is not an array, an error condition is raised. ;; diff --git a/test/monger/test/atomic_modifiers_test.clj b/test/monger/test/atomic_modifiers_test.clj index 0eb6fbb..23cdacb 100644 --- a/test/monger/test/atomic_modifiers_test.clj +++ b/test/monger/test/atomic_modifiers_test.clj @@ -174,7 +174,7 @@ ;; this is a common mistake, I leave it here to demonstrate it. You almost never - ;; actually want to do this! What you really want is to use $pushAll instead of $push. MK. + ;; actually want to do this! What you really want is to use $push with $each instead of $push. MK. (deftest add-array-value-to-an-existing-array-using-$push-modifier (let [coll "docs" oid (ObjectId.) @@ -228,34 +228,34 @@ (mc/find-map-by-id db coll oid))))) ;; - ;; $pushAll + ;; $push + $each (formerly $pushAll) ;; - (deftest initialize-an-array-using-$pushAll-modifier + (deftest initialize-an-array-using-$push-and-$each-modifiers (let [coll "docs" oid (ObjectId.) title "$pushAll modifier appends multiple values to field"] (mc/insert db coll {:_id oid :title title}) - (mc/update db coll {:_id oid} {$pushAll {:tags ["mongodb" "docs"]}}) + (mc/update db coll {:_id oid} {$push {:tags {$each ["mongodb" "docs"]}}}) (is (= {:_id oid :title title :tags ["mongodb" "docs"]} (mc/find-map-by-id db coll oid))))) - (deftest add-value-to-an-existing-array-using-$pushAll-modifier + (deftest add-value-to-an-existing-array-using-$push-and-$each-modifier (let [coll "docs" oid (ObjectId.) title "$pushAll modifier appends multiple values to field"] (mc/insert db coll {:_id oid :title title :tags ["mongodb"]}) - (mc/update db coll {:_id oid} {$pushAll {:tags ["modifiers" "docs"]}}) + (mc/update db coll {:_id oid} {$push {:tags {$each ["modifiers" "docs"]}}}) (is (= {:_id oid :title title :tags ["mongodb" "modifiers" "docs"]} (mc/find-map-by-id db coll oid))))) - (deftest double-add-value-to-an-existing-array-using-$pushAll-modifier + (deftest double-add-value-to-an-existing-array-using-$push-and-$each-modifier (let [coll "docs" oid (ObjectId.) title "$pushAll modifier appends multiple values to field"] (mc/insert db coll {:_id oid :title title :tags ["mongodb" "docs"]}) - (mc/update db coll {:_id oid} {$pushAll {:tags ["modifiers" "docs"]}}) + (mc/update db coll {:_id oid} {$push {:tags {$each ["modifiers" "docs"]}}}) (is (= {:_id oid :title title :tags ["mongodb" "docs" "modifiers" "docs"]} (mc/find-map-by-id db coll oid))))) From ba00ba27a5ea97d20ad15c6abe68df428bdf8d54 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:24:05 +0300 Subject: [PATCH 04/24] Encode this slash in URI --- test/monger/test/authentication_test.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/monger/test/authentication_test.clj b/test/monger/test/authentication_test.clj index e8d5447..06acb7b 100644 --- a/test/monger/test/authentication_test.clj +++ b/test/monger/test/authentication_test.clj @@ -15,7 +15,7 @@ (is (-> conn .getAddress (.sameHost "127.0.0.1"))))) (deftest ^{:authentication true} connect-to-mongo-via-uri-with-valid-credentials - (let [{:keys [conn db]} (mg/connect-via-uri "mongodb://clojurewerkz/monger:monger@127.0.0.1/monger-test4")] + (let [{:keys [conn db]} (mg/connect-via-uri "mongodb://clojurewerkz%2Fmonger:monger@127.0.0.1/monger-test4")] (is (= "monger-test4" (.getName db))) (is (-> conn .getAddress (.sameHost "127.0.0.1"))) (mc/remove db "documents") From 386f06da8c0cac99cfbb8a2c43838afe3b80be2e Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:24:29 +0300 Subject: [PATCH 05/24] Update dependencies, adapt to new core.cache and Ragtime APIs --- project.clj | 39 +++++---- src/clojure/monger/ragtime.clj | 8 +- test/monger/test/cache_test.clj | 126 ------------------------------ test/monger/test/ragtime_test.clj | 2 +- 4 files changed, 23 insertions(+), 152 deletions(-) delete mode 100644 test/monger/test/cache_test.clj diff --git a/project.clj b/project.clj index c66a4b9..d1df9b3 100644 --- a/project.clj +++ b/project.clj @@ -4,8 +4,8 @@ :min-lein-version "2.5.1" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} - :dependencies [[org.clojure/clojure "1.8.0"] - [org.mongodb/mongodb-driver "3.8.0"] + :dependencies [[org.clojure/clojure "1.9.0"] + [org.mongodb/mongodb-driver "3.9.1"] [clojurewerkz/support "1.1.0"]] :test-selectors {:default (fn [m] (and (not (:performance m)) @@ -31,31 +31,28 @@ :mailing-list {:name "clojure-mongodb" :archive "https://groups.google.com/group/clojure-mongodb" :post "clojure-mongodb@googlegroups.com"} - :profiles {:dj02x {:dependencies [[org.clojure/data.json "0.2.6" :exclusions [org.clojure/clojure]]]} - :1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} - :1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]} - :1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha13"]]} - :master {:dependencies [[org.clojure/clojure "1.9.0-master-SNAPSHOT"]]} + :profiles {:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]} + :master {:dependencies [[org.clojure/clojure "1.10.0-master-SNAPSHOT"]]} :dev {:resource-paths ["test/resources"] - :dependencies [[clj-time "0.8.0" :exclusions [org.clojure/clojure]] - [cheshire "5.5.0" :exclusions [org.clojure/clojure]] - [org.clojure/data.json "0.2.5" :exclusions [org.clojure/clojure]] - [org.clojure/tools.cli "0.3.1" :exclusions [org.clojure/clojure]] - [org.clojure/core.cache "0.6.3" :exclusions [org.clojure/clojure]] - [ring/ring-core "1.3.0" :exclusions [org.clojure/clojure]] - [com.novemberain/validateur "2.4.2" :exclusions [org.clojure/clojure]] - [ch.qos.logback/logback-classic "1.1.3" :exclusions [org.slf4j/slf4j-api]] - [ragtime/ragtime.core "0.3.7" :exclusions [org.clojure/clojure]]] - :plugins [[lein-codox "0.9.0"]] + :dependencies [[clj-time "0.15.1" :exclusions [org.clojure/clojure]] + [cheshire "5.8.1" :exclusions [org.clojure/clojure]] + [org.clojure/data.json "0.2.6" :exclusions [org.clojure/clojure]] + [org.clojure/tools.cli "0.4.1" :exclusions [org.clojure/clojure]] + [org.clojure/core.cache "0.7.1" :exclusions [org.clojure/clojure]] + [ring/ring-core "1.7.1" :exclusions [org.clojure/clojure]] + [com.novemberain/validateur "2.6.0" :exclusions [org.clojure/clojure]] + [ch.qos.logback/logback-classic "1.2.3" :exclusions [org.slf4j/slf4j-api]] + [ragtime/core "0.7.2" :exclusions [org.clojure/clojure]]] + :plugins [[lein-codox "0.10.5"]] :codox {:source-paths ["src/clojure"] :namespaces [#"^monger\.(?!internal)"]}} ;; only clj-time/JodaTime available, used to test monger.joda-time w/o clojure.data.json :dev2 {:resource-paths ["test/resources"] - :dependencies [[clj-time "0.8.0" :exclusions [org.clojure/clojure]]]}} - :aliases {"all" ["with-profile" "dev:dev,1.6:dev,1.8:dev,dj02x"]} - :repositories {"sonatype" {:url "http://oss.sonatype.org/content/repositories/releases" + :dependencies [[clj-time "0.15.1" :exclusions [org.clojure/clojure]]]}} + :aliases {"all" ["with-profile" "dev:dev,1.8:dev,master"]} + :repositories {"sonatype" {:url "https://oss.sonatype.org/content/repositories/releases" :snapshots false :releases {:checksum :fail :update :always}} - "sonatype-snapshots" {:url "http://oss.sonatype.org/content/repositories/snapshots" + "sonatype-snapshots" {:url "https://oss.sonatype.org/content/repositories/snapshots" :snapshots true :releases {:checksum :fail :update :always}}}) diff --git a/src/clojure/monger/ragtime.clj b/src/clojure/monger/ragtime.clj index 71db197..94a2d27 100644 --- a/src/clojure/monger/ragtime.clj +++ b/src/clojure/monger/ragtime.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of @@ -34,7 +34,7 @@ (ns monger.ragtime "Ragtime integration" (:refer-clojure :exclude [find sort]) - (:require [ragtime.core :as ragtime] + (:require [ragtime.protocols :as proto] [monger.core :as mg] [monger.collection :as mc] [monger.query :refer [with-collection find sort]]) @@ -47,7 +47,7 @@ (extend-type com.mongodb.DB - ragtime/Migratable + proto/DataStore (add-migration-id [db id] (mc/insert db migrations-collection {:_id id :created_at (Date.)} WriteConcern/FSYNC_SAFE)) (remove-migration-id [db id] diff --git a/test/monger/test/cache_test.clj b/test/monger/test/cache_test.clj deleted file mode 100644 index 0845af0..0000000 --- a/test/monger/test/cache_test.clj +++ /dev/null @@ -1,126 +0,0 @@ -(ns monger.test.cache-test - (:require [monger.core :as mg] - [monger.collection :as mc] - [clojure.core.cache :refer :all] - [clojure.test :refer :all] - [monger.cache :refer :all]) - (:import [clojure.core.cache BasicCache FIFOCache LRUCache TTLCache] - java.util.UUID)) - -;; -;; Playground/Tests. These were necessary because clojure.core.cache has -;; little documentation, incomplete test suite and -;; slightly non-standard (although necessary to support all those cache variations) -;; cache operations protocol. -;; -;; This is by no means clear or complete either but it did the job of helping me -;; explore the API. - -(deftest ^{:cache true} - test-has?-with-basic-cache - (testing "that has? returns false for misses" - (let [c (BasicCache. {})] - (are [v] (is (false? (has? c v))) - :missing-key - "missing-key" - (gensym "missing-key")))) - (testing "that has? returns true for hits" - (let [c (BasicCache. {:skey "Value" :lkey (Long/valueOf 10000) "kkey" :keyword})] - (are [v] (is (has? c v)) - :skey - :lkey - "kkey")))) - - -(deftest ^{:cache true} - test-lookup-with-basic-cache - (testing "that lookup returns nil for misses" - (let [c (BasicCache. {})] - (are [v] (is (nil? (lookup c v))) - :missing-key - "missing-key" - (gensym "missing-key")))) - (testing "that lookup returns cached values for hits" - (let [l (Long/valueOf 10000) - c (BasicCache. {:skey "Value" :lkey l "kkey" :keyword})] - (are [v k] (is (= v (lookup c k))) - "Value" :skey - l :lkey - :keyword "kkey")))) - -(deftest ^{:cache true} - test-evict-with-basic-cache - (testing "that evict has no effect for keys that do not exist" - (let [c (atom (BasicCache. {:a 1 :b 2}))] - (swap! c evict :missing-key) - (is (has? @c :a)) - (is (has? @c :b)))) - (testing "that evict removes keys that did exist" - (let [c (atom (BasicCache. {:skey "Value" "kkey" :keyword}))] - (is (has? @c :skey)) - (is (= "Value" (lookup @c :skey))) - (swap! c evict :skey) - (is (not (has? @c :skey))) - (is (= nil (lookup @c :skey))) - (is (has? @c "kkey")) - (is (= :keyword (lookup @c "kkey")))))) - -(deftest ^{:cache true} - test-seed-with-basic-cache - (testing "that seed returns a new value" - (let [c (atom (BasicCache. {}))] - (swap! c seed {:a 1 :b "b" "c" :d}) - (are [k v] (do - (is (has? @c k)) - (is (= v (lookup @c k)))) - :a 1 - :b "b" - "c" :d)))) - - -;; -;; Tests -;; - -(let [conn (mg/connect) - db (mg/get-db conn "monger-test")] - (use-fixtures :each (fn [f] - (mc/remove db "basic_monger_cache_entries") - (f) - (mc/remove db "basic_monger_cache_entries"))) - - - (deftest ^{:cache true} - test-has?-with-basic-monger-cache - (testing "that has? returns false for misses" - (let [coll "basic_monger_cache_entries" - c (basic-monger-cache-factory db coll)] - (is (not (has? c (str (UUID/randomUUID))))) - (is (not (has? c (str (UUID/randomUUID))))))) - (testing "that has? returns true for hits" - (let [coll "basic_monger_cache_entries" - c (basic-monger-cache-factory db coll {"a" 1 "b" "cache" "c" 3/4})] - (is (has? c "a")) - (is (has? c "b")) - (is (has? c "c")) - (is (not (has? c "d")))))) - - - (deftest ^{:cache true} - test-lookup-with-basic-monger-cache - (testing "that lookup returns nil for misses" - (let [coll "basic_monger_cache_entries" - c (basic-monger-cache-factory db coll)] - (are [v] (is (nil? (lookup c v))) - :missing-key - "missing-key" - (gensym "missing-key")))) - (testing "that lookup returns cached values for hits" - (let [l (Long/valueOf 10000) - coll "basic_monger_cache_entries" - c (basic-monger-cache-factory db coll {:skey "Value" :lkey l "kkey" :keyword})] - (are [v k] (is (= v (lookup c k))) - "Value" :skey - l :lkey - "keyword" "kkey"))))) - diff --git a/test/monger/test/ragtime_test.clj b/test/monger/test/ragtime_test.clj index c972396..9a6b448 100644 --- a/test/monger/test/ragtime_test.clj +++ b/test/monger/test/ragtime_test.clj @@ -2,7 +2,7 @@ (:require [monger.core :as mg] [monger.collection :as mc] monger.ragtime - [ragtime.core :refer :all] + [ragtime.protocols :refer :all] [clojure.test :refer :all])) From 8879e552efcf783eeddf03a4119e9bf624eb13b6 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:37:30 +0300 Subject: [PATCH 06/24] Make before_script.sh compatible with MongoDB 4.0 Note that MongoDB 3.6 doesn't recognize the mechanisms field. --- bin/ci/before_script.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh index 5bca8eb..711d6dd 100755 --- a/bin/ci/before_script.sh +++ b/bin/ci/before_script.sh @@ -5,7 +5,7 @@ sleep 5 # MongoDB Java driver won't run authentication twice on the same DB instance, # so we need to use multiple DBs. -mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"]})' monger-test -mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"]})' monger-test2 -mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"]})' monger-test3 -mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"]})' monger-test4 +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], mechanisms: ["SCRAM-SHA-1"], passwordDigestor: "client"})' monger-test +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], mechanisms: ["SCRAM-SHA-1"], passwordDigestor: "client"})' monger-test2 +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], mechanisms: ["SCRAM-SHA-1"], passwordDigestor: "client"})' monger-test3 +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], mechanisms: ["SCRAM-SHA-1"], passwordDigestor: "client"})' monger-test4 From a153eb8116050aa0cd1196e9771e3433c472539b Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:38:56 +0300 Subject: [PATCH 07/24] Travis: provision MongoDB 4.x --- bin/ci/install_mongodb.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ci/install_mongodb.sh b/bin/ci/install_mongodb.sh index 6645e06..b3d5a7a 100755 --- a/bin/ci/install_mongodb.sh +++ b/bin/ci/install_mongodb.sh @@ -1,8 +1,8 @@ #!/bin/sh -#sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6 -echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org.list +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 + +echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list sudo apt-get update sudo apt-get install -y mongodb-org From 3757c6d915318f8b8e49f53440b508aedde0c187 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:42:29 +0300 Subject: [PATCH 08/24] Add a 3.6.x-compatible test seed script --- bin/ci/before_script_server_3.6.x.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/ci/before_script_server_3.6.x.sh diff --git a/bin/ci/before_script_server_3.6.x.sh b/bin/ci/before_script_server_3.6.x.sh new file mode 100755 index 0000000..c8ffd7c --- /dev/null +++ b/bin/ci/before_script_server_3.6.x.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# MongoDB seems to need some time to boot first. MK. +sleep 5 + +# MongoDB Java driver won't run authentication twice on the same DB instance, +# so we need to use multiple DBs. +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], passwordDigestor: "client"})' monger-test +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], passwordDigestor: "client"})' monger-test2 +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], passwordDigestor: "client"})' monger-test3 +mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], passwordDigestor: "client"})' monger-test4 From 318e440d0db0a27317703788be6b8493caeb3f50 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:45:26 +0300 Subject: [PATCH 09/24] (c) year --- src/clojure/monger/cache.clj | 4 ++-- src/clojure/monger/collection.clj | 4 ++-- src/clojure/monger/command.clj | 4 ++-- src/clojure/monger/constraints.clj | 4 ++-- src/clojure/monger/conversion.clj | 4 ++-- src/clojure/monger/core.clj | 4 ++-- src/clojure/monger/credentials.clj | 4 ++-- src/clojure/monger/cursor.clj | 4 ++-- src/clojure/monger/db.clj | 4 ++-- src/clojure/monger/gridfs.clj | 4 ++-- src/clojure/monger/internal/pagination.clj | 4 ++-- src/clojure/monger/joda_time.clj | 4 ++-- src/clojure/monger/js.clj | 4 ++-- src/clojure/monger/json.clj | 4 ++-- src/clojure/monger/operators.clj | 4 ++-- src/clojure/monger/query.clj | 4 ++-- src/clojure/monger/result.clj | 4 ++-- src/clojure/monger/ring/session_store.clj | 4 ++-- src/clojure/monger/util.clj | 4 ++-- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/clojure/monger/cache.clj b/src/clojure/monger/cache.clj index 4156b38..b4f4b72 100644 --- a/src/clojure/monger/cache.clj +++ b/src/clojure/monger/cache.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/collection.clj b/src/clojure/monger/collection.clj index 0a50e97..df7a6c1 100644 --- a/src/clojure/monger/collection.clj +++ b/src/clojure/monger/collection.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; Copyright (c) 2012 Toby Hede ;; Copyright (c) 2012 Baishampayan Ghose ;; @@ -24,7 +24,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; Copyright (c) 2012 Toby Hede ;; Copyright (c) 2012 Baishampayan Ghose ;; diff --git a/src/clojure/monger/command.clj b/src/clojure/monger/command.clj index 6f823a9..c349e75 100644 --- a/src/clojure/monger/command.clj +++ b/src/clojure/monger/command.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; Copyright (c) 2012 Toby Hede ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; Copyright (c) 2012 Toby Hede ;; All rights reserved. ;; diff --git a/src/clojure/monger/constraints.clj b/src/clojure/monger/constraints.clj index 3eb39c2..41e66f0 100644 --- a/src/clojure/monger/constraints.clj +++ b/src/clojure/monger/constraints.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/conversion.clj b/src/clojure/monger/conversion.clj index 02e97a5..729b09f 100644 --- a/src/clojure/monger/conversion.clj +++ b/src/clojure/monger/conversion.clj @@ -5,7 +5,7 @@ ;; ;; ---------------------------------------------------------------------------------- ;; Portions of the code are Copyright (c) 2009 Andrew Boekhoff -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ ;; ;; ---------------------------------------------------------------------------------- ;; Portions of the code are Copyright (c) 2009 Andrew Boekhoff -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/core.clj b/src/clojure/monger/core.clj index d7589ef..880a259 100644 --- a/src/clojure/monger/core.clj +++ b/src/clojure/monger/core.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/credentials.clj b/src/clojure/monger/credentials.clj index 856dc67..009145f 100644 --- a/src/clojure/monger/credentials.clj +++ b/src/clojure/monger/credentials.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/cursor.clj b/src/clojure/monger/cursor.clj index 39acb43..dc102c7 100644 --- a/src/clojure/monger/cursor.clj +++ b/src/clojure/monger/cursor.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/db.clj b/src/clojure/monger/db.clj index cdaca66..19d6305 100644 --- a/src/clojure/monger/db.clj +++ b/src/clojure/monger/db.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; Copyright (c) 2012 Toby Hede ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; Copyright (c) 2012 Toby Hede ;; All rights reserved. ;; diff --git a/src/clojure/monger/gridfs.clj b/src/clojure/monger/gridfs.clj index a3f60f9..e42c168 100644 --- a/src/clojure/monger/gridfs.clj +++ b/src/clojure/monger/gridfs.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/internal/pagination.clj b/src/clojure/monger/internal/pagination.clj index b5b3259..dab3032 100644 --- a/src/clojure/monger/internal/pagination.clj +++ b/src/clojure/monger/internal/pagination.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/joda_time.clj b/src/clojure/monger/joda_time.clj index 940ca3e..dd563a2 100644 --- a/src/clojure/monger/joda_time.clj +++ b/src/clojure/monger/joda_time.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/js.clj b/src/clojure/monger/js.clj index 51f8da7..32ab680 100644 --- a/src/clojure/monger/js.clj +++ b/src/clojure/monger/js.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/json.clj b/src/clojure/monger/json.clj index 4fb14d8..ceaba68 100644 --- a/src/clojure/monger/json.clj +++ b/src/clojure/monger/json.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/operators.clj b/src/clojure/monger/operators.clj index 0b4a6a8..27c3016 100644 --- a/src/clojure/monger/operators.clj +++ b/src/clojure/monger/operators.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/query.clj b/src/clojure/monger/query.clj index e8caa65..9484d99 100644 --- a/src/clojure/monger/query.clj +++ b/src/clojure/monger/query.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/result.clj b/src/clojure/monger/result.clj index 1663e18..1a4c9f9 100644 --- a/src/clojure/monger/result.clj +++ b/src/clojure/monger/result.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/ring/session_store.clj b/src/clojure/monger/ring/session_store.clj index 76ff459..0b316ae 100644 --- a/src/clojure/monger/ring/session_store.clj +++ b/src/clojure/monger/ring/session_store.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of diff --git a/src/clojure/monger/util.clj b/src/clojure/monger/util.clj index 70aeb4f..40ffe7b 100644 --- a/src/clojure/monger/util.clj +++ b/src/clojure/monger/util.clj @@ -4,7 +4,7 @@ ;; The APL v2.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team ;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ ;; The EPL v1.0: ;; ;; ---------------------------------------------------------------------------------- -;; Copyright (c) 2011-2015 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. +;; Copyright (c) 2011-2018 Michael S. Klishin, Alex Petrov, and the ClojureWerkz Team. ;; All rights reserved. ;; ;; This program and the accompanying materials are made available under the terms of From 6bf528ed5b8a21153e3df1aa0cd1d88e08f31e3a Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 21:45:44 +0300 Subject: [PATCH 10/24] Bump version to 3.5.0 There are breaking changes that reflect breaking changes in Monger's dependencies: * MongoDB server and Java client * core.cache * Ragtime While not major, they can be breaking nonetheless so let's use a greater minor version bump than usual to communicate the greater than usual number of changes. --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index d1df9b3..87747f7 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.novemberain/monger "3.2.0-SNAPSHOT" +(defproject com.novemberain/monger "3.5.0-SNAPSHOT" :description "Monger is a Clojure MongoDB client for a more civilized age: friendly, flexible and with batteries included" :url "http://clojuremongodb.info" :min-lein-version "2.5.1" From 79bd0aabca2745157f5950652439b1595466e99f Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 22:18:53 +0300 Subject: [PATCH 11/24] 3.5.0-rc1 --- README.md | 24 +++++++++++++----------- project.clj | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7b717aa..b71aa01 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,18 @@ [![Build Status](https://travis-ci.org/xingzhefeng/monger.svg?branch=master)](https://travis-ci.org/xingzhefeng/monger) Monger is an idiomatic [Clojure MongoDB driver](http://clojuremongodb.info) for a more civilized age. -It has batteries included, offers powerful expressive query DSL, strives to support every MongoDB 2.0+ feature and has sane defaults. Monger is built from for modern Clojure versions and sits on top of the official MongoDB Java driver. +It has batteries included, offers powerful expressive query DSL, +strives to support modern MongoDB features and have the "look and feel" and +flexibility of the MongoDB shell. + +Monger is built from for modern Clojure versions and sits on top of +the official MongoDB Java driver. ## Project Goals There is one MongoDB client for Clojure that has been around since 2009. So, why create another one? Monger authors -wanted a client that will +wanted a client that would * Support most of modern MongoDB features, focus on those that really matter. * Be [well documented](http://clojuremongodb.info). @@ -45,14 +50,14 @@ Maven, add the following repository definition to your `pom.xml`: With Leiningen: - [com.novemberain/monger "3.1.0"] + [com.novemberain/monger "3.5.0-rc1"] With Maven: com.novemberain monger - 3.1.0 + 3.5.0-rc1 @@ -70,15 +75,13 @@ questions, too! Please see our [documentation guides site](http://clojuremongodb.info/) and [API reference](http://reference.clojuremongodb.info). -Our [test -suite](https://github.com/michaelklishin/monger/tree/master/test/monger/test) +Our [test suite](https://github.com/michaelklishin/monger/tree/master/test/monger/test) also has many code examples. ## Community -[Monger has a mailing -list](https://groups.google.com/forum/#!forum/clojure-mongodb). Feel +[Monger has a mailing list](https://groups.google.com/forum/#!forum/clojure-mongodb). Feel free to join it and ask any questions you may have. To subscribe for announcements of releases, important changes and so @@ -88,14 +91,13 @@ on Twitter. ## Supported Clojure versions -Monger requires Clojure 1.6+. The most recent +Monger requires Clojure 1.8+. The most recent stable release is highly recommended. ## Continuous Integration Status [![Continuous Integration status](https://secure.travis-ci.org/michaelklishin/monger.svg)](http://travis-ci.org/michaelklishin/monger) -[![Dependencies Status](http://jarkeeper.com/michaelklishin/monger/status.svg)](http://jarkeeper.com/michaelklishin/monger) ## Monger Is a ClojureWerkz Project @@ -120,7 +122,7 @@ on Github. ## License -Copyright (C) 2011-2016 [Michael S. Klishin](http://twitter.com/michaelklishin), Alex Petrov, and the ClojureWerkz team. +Copyright (C) 2011-2018 [Michael S. Klishin](http://twitter.com/michaelklishin), Alex Petrov, and the ClojureWerkz team. Double licensed under the [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html) (the same as Clojure) or the [Apache Public License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/project.clj b/project.clj index 87747f7..ab58703 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.novemberain/monger "3.5.0-SNAPSHOT" +(defproject com.novemberain/monger "3.5.0-rc1" :description "Monger is a Clojure MongoDB client for a more civilized age: friendly, flexible and with batteries included" :url "http://clojuremongodb.info" :min-lein-version "2.5.1" From 4b591fc910bfaf4d576e0aa941469c70eca98145 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sun, 2 Dec 2018 22:27:46 +0300 Subject: [PATCH 12/24] Back to dev version --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index ab58703..87747f7 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.novemberain/monger "3.5.0-rc1" +(defproject com.novemberain/monger "3.5.0-SNAPSHOT" :description "Monger is a Clojure MongoDB client for a more civilized age: friendly, flexible and with batteries included" :url "http://clojuremongodb.info" :min-lein-version "2.5.1" From aa08f4b58c50c2583022c7ba0591f0203812bff6 Mon Sep 17 00:00:00 2001 From: Chris Broome Date: Mon, 3 Dec 2018 22:12:45 -0500 Subject: [PATCH 13/24] Add more descriptive error message when uri has no db name --- src/clojure/monger/core.clj | 11 +++++++---- test/monger/test/core_test.clj | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/clojure/monger/core.clj b/src/clojure/monger/core.clj index 880a259..5573bc6 100644 --- a/src/clojure/monger/core.clj +++ b/src/clojure/monger/core.clj @@ -233,10 +233,13 @@ Commonly used for PaaS-based applications, for example, running on Heroku. If username and password are provided, performs authentication." [^String uri-string] - (let [uri (MongoClientURI. uri-string) - conn (MongoClient. uri) - db (.getDB conn (.getDatabase uri))] - {:conn conn :db db})) + (let [uri (MongoClientURI. uri-string) + conn (MongoClient. uri) + dbName (.getDatabase uri)] + (if (nil? dbName) + (throw (Exception. "No database name specified in uri")) + (let [db (.getDB conn dbName)] + {:conn conn :db db})))) (defn ^com.mongodb.CommandResult command "Runs a database command (please check MongoDB documentation for the complete list of commands). diff --git a/test/monger/test/core_test.clj b/test/monger/test/core_test.clj index eeaa5b6..c8082ce 100644 --- a/test/monger/test/core_test.clj +++ b/test/monger/test/core_test.clj @@ -70,3 +70,7 @@ :cursor-finalizer-enabled true :required-replica-set-name "rs"}] (is (instance? com.mongodb.MongoClientOptions$Builder (mg/mongo-options-builder opts))))) + +(deftest connect-to-uri-without-db-name + (let [uri "mongodb://localhost:27017"] + (is (thrown? Exception (mg/connect-via-uri uri))))) From 9d34fc02316efc75694e841d40b48e6cee05a309 Mon Sep 17 00:00:00 2001 From: Chris Broome Date: Tue, 4 Dec 2018 21:20:25 -0500 Subject: [PATCH 14/24] Throw IllegalArgumentException when database name not in uri --- src/clojure/monger/core.clj | 4 ++-- test/monger/test/core_test.clj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clojure/monger/core.clj b/src/clojure/monger/core.clj index 5573bc6..fe24ec1 100644 --- a/src/clojure/monger/core.clj +++ b/src/clojure/monger/core.clj @@ -236,8 +236,8 @@ (let [uri (MongoClientURI. uri-string) conn (MongoClient. uri) dbName (.getDatabase uri)] - (if (nil? dbName) - (throw (Exception. "No database name specified in uri")) + (if (not dbName) + (throw (IllegalArgumentException. "No database name specified in uri")) (let [db (.getDB conn dbName)] {:conn conn :db db})))) diff --git a/test/monger/test/core_test.clj b/test/monger/test/core_test.clj index c8082ce..02f45dc 100644 --- a/test/monger/test/core_test.clj +++ b/test/monger/test/core_test.clj @@ -73,4 +73,4 @@ (deftest connect-to-uri-without-db-name (let [uri "mongodb://localhost:27017"] - (is (thrown? Exception (mg/connect-via-uri uri))))) + (is (thrown? IllegalArgumentException (mg/connect-via-uri uri))))) From 8102c42888ed797cb1b77c0c4dce57e2199c02dd Mon Sep 17 00:00:00 2001 From: Chris Broome Date: Tue, 4 Dec 2018 22:33:34 -0500 Subject: [PATCH 15/24] TravisCI: change dist to xenial - Change distribution to `xenial` - Remove custom mongodb 4.0 installation since xenial ships with 4.0 - Increase wait time from 5 to 15 seconds --- .travis.yml | 2 +- bin/ci/before_script.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9e866d..62d76e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: clojure sudo: required lein: lein +dist: xenial before_script: - - ./bin/ci/install_mongodb.sh - mongod --version - ./bin/ci/before_script.sh script: lein do clean, javac, test diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh index 711d6dd..77f1a97 100755 --- a/bin/ci/before_script.sh +++ b/bin/ci/before_script.sh @@ -1,7 +1,7 @@ #!/bin/sh # MongoDB seems to need some time to boot first. MK. -sleep 5 +sleep 15 # MongoDB Java driver won't run authentication twice on the same DB instance, # so we need to use multiple DBs. From 900592e302c40d30457500a05cac262b7ffbf382 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 7 Dec 2018 19:51:59 +0300 Subject: [PATCH 16/24] Cosmetics, wording --- src/clojure/monger/core.clj | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/clojure/monger/core.clj b/src/clojure/monger/core.clj index fe24ec1..e5314a0 100644 --- a/src/clojure/monger/core.clj +++ b/src/clojure/monger/core.clj @@ -234,12 +234,10 @@ If username and password are provided, performs authentication." [^String uri-string] (let [uri (MongoClientURI. uri-string) - conn (MongoClient. uri) - dbName (.getDatabase uri)] - (if (not dbName) - (throw (IllegalArgumentException. "No database name specified in uri")) - (let [db (.getDB conn dbName)] - {:conn conn :db db})))) + conn (MongoClient. uri)] + (if-let [dbName (.getDatabase uri)] + {:conn conn :db (.getDB conn dbName)} + (throw (IllegalArgumentException. "No database name specified in URI. Monger requires a database to be explicitly configured."))))) (defn ^com.mongodb.CommandResult command "Runs a database command (please check MongoDB documentation for the complete list of commands). From d6f5ac743ddd9f0e9010b97970805180df1999f5 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 7 Dec 2018 19:55:34 +0300 Subject: [PATCH 17/24] Compile for JDK 8 --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 87747f7..59759fd 100644 --- a/project.clj +++ b/project.clj @@ -27,7 +27,7 @@ :all (constantly true)} :source-paths ["src/clojure"] :java-source-paths ["src/java"] - :javac-options ["-target" "1.7" "-source" "1.7"] + :javac-options ["-target" "1.8" "-source" "1.8"] :mailing-list {:name "clojure-mongodb" :archive "https://groups.google.com/group/clojure-mongodb" :post "clojure-mongodb@googlegroups.com"} From 1e313f990c82ef13e7ffa01fe30e965d49fdb258 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 7 Dec 2018 20:01:09 +0300 Subject: [PATCH 18/24] Change log updates --- ChangeLog.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index b3e1554..af2436e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,13 +1,26 @@ -## Changes between 3.1.x and 3.2.0 (unreleased) +## Changes between 3.1.x and 3.5.0 (unreleased) ### MongoDB Java Driver Update -MongoDB Java driver dependency has been updated to `3.4.x`. +MongoDB Java driver dependency has been updated to `3.9.x`. -This means that Monger now **requires JDK 7**. +This means that Monger now **requires JDK 8**. Contributed by @Linicks. +### 3rd Party Library Compatibility + + * Cheshire `5.8.x` + * clj-time `0.15.1` + * ring-core `0.15.1` + * Ragtime `0.7.x`. + +### URI Connection Usability Improvement + +URIs that don't specify a database will now be rejected as invalid. + +Contributed by Chris Broome. + ## Changes between 3.0.x and 3.1.0 (September 17th, 2016) From 3a94b2a805fcf27bad06a60f1afd1e0acd20aa3a Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sat, 8 Dec 2018 22:50:07 +0300 Subject: [PATCH 19/24] Move the sleep to .travis.yml Since it's only really necessary in CI scenarios. --- .travis.yml | 6 ++++-- bin/ci/before_script.sh | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62d76e3..745a331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,17 @@ sudo: required lein: lein dist: xenial before_script: + # Give MongoDB server some time to boot + - sleep 15 - mongod --version - ./bin/ci/before_script.sh script: lein do clean, javac, test jdk: - oraclejdk8 - - oraclejdk9 + - oraclejdk11 services: - mongodb branches: only: - master - - 3.0.x-stable + - 3.5.x-stable diff --git a/bin/ci/before_script.sh b/bin/ci/before_script.sh index 77f1a97..fae6dd8 100755 --- a/bin/ci/before_script.sh +++ b/bin/ci/before_script.sh @@ -1,8 +1,5 @@ #!/bin/sh -# MongoDB seems to need some time to boot first. MK. -sleep 15 - # MongoDB Java driver won't run authentication twice on the same DB instance, # so we need to use multiple DBs. mongo --eval 'db.createUser({"user": "clojurewerkz/monger", "pwd": "monger", roles: ["dbAdmin"], mechanisms: ["SCRAM-SHA-1"], passwordDigestor: "client"})' monger-test From a3f6982a61a6bd367b97a739ea76ad46b9715157 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sat, 8 Dec 2018 22:54:23 +0300 Subject: [PATCH 20/24] 3.5.0 --- README.md | 4 ++-- project.clj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b71aa01..fda4cf0 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,14 @@ Maven, add the following repository definition to your `pom.xml`: With Leiningen: - [com.novemberain/monger "3.5.0-rc1"] + [com.novemberain/monger "3.5.0"] With Maven: com.novemberain monger - 3.5.0-rc1 + 3.5.0 diff --git a/project.clj b/project.clj index 59759fd..c3784fa 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.novemberain/monger "3.5.0-SNAPSHOT" +(defproject com.novemberain/monger "3.5.0" :description "Monger is a Clojure MongoDB client for a more civilized age: friendly, flexible and with batteries included" :url "http://clojuremongodb.info" :min-lein-version "2.5.1" From 805383f1ec063993b25e54e7ae8a7806f427cad9 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Mon, 10 Dec 2018 15:28:35 +0300 Subject: [PATCH 21/24] Back to dev version --- .travis.yml | 3 ++- project.clj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 745a331..a5a9058 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,9 @@ before_script: - ./bin/ci/before_script.sh script: lein do clean, javac, test jdk: - - oraclejdk8 + - oraclejdk10 - oraclejdk11 + - oraclejdk12 services: - mongodb branches: diff --git a/project.clj b/project.clj index c3784fa..80dd2c1 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject com.novemberain/monger "3.5.0" +(defproject com.novemberain/monger "3.6.0-SNAPSHOT" :description "Monger is a Clojure MongoDB client for a more civilized age: friendly, flexible and with batteries included" :url "http://clojuremongodb.info" :min-lein-version "2.5.1" From efc440a8f99f15f4e97ddd62b0d98bf507d4529e Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Mon, 10 Dec 2018 15:41:15 +0300 Subject: [PATCH 22/24] Change log updates --- ChangeLog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index af2436e..5ca646e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,9 @@ -## Changes between 3.1.x and 3.5.0 (unreleased) +## Changes between 3.5.x and 3.6.0 (unreleased) + +No changes yet. + + +## Changes between 3.1.x and 3.5.0 (Dec 10th, 2018) ### MongoDB Java Driver Update From ba29a45cc668f9b1c1b4c9375c62b54bd6751275 Mon Sep 17 00:00:00 2001 From: Jiacai Liu Date: Thu, 28 Feb 2019 16:48:06 +0800 Subject: [PATCH 23/24] support set max-time on cursor --- src/clojure/monger/query.clj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/clojure/monger/query.clj b/src/clojure/monger/query.clj index 9484d99..7320722 100644 --- a/src/clojure/monger/query.clj +++ b/src/clojure/monger/query.clj @@ -43,6 +43,7 @@ [monger.conversion :refer :all] [monger.operators :refer :all]) (:import [com.mongodb DB DBCollection DBObject DBCursor ReadPreference] + [java.util.concurrent TimeUnit] java.util.List)) @@ -96,6 +97,7 @@ snapshot read-preference keywordize-fields + max-time options] :or { limit 0 batch-size 256 skip 0 } }] (with-open [cursor (doto (.find collection (to-db-object query) (as-field-selector fields)) @@ -109,6 +111,8 @@ (.hint cursor (to-db-object hint))) (when read-preference (.setReadPreference cursor read-preference)) + (when max-time + (.maxTime cursor max-time TimeUnit/MILLISECONDS)) (when options (add-options cursor options)) (map (fn [x] (from-db-object x keywordize-fields)) @@ -154,6 +158,10 @@ [m ^ReadPreference rp] (merge m { :read-preference rp })) +(defn max-time + [m ^long max-time] + (merge m { :max-time max-time })) + (defn options [m opts] (merge m { :options opts })) From affeb65d0039b4f0ef6b2455f423c7a058898a1d Mon Sep 17 00:00:00 2001 From: Juvenn Woo Date: Wed, 10 Apr 2019 12:13:59 +0800 Subject: [PATCH 24/24] Try to use openjdk for travis build --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a5a9058..8028713 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,9 @@ before_script: - ./bin/ci/before_script.sh script: lein do clean, javac, test jdk: - - oraclejdk10 + - openjdk10 - oraclejdk11 - - oraclejdk12 + - openjdk12 services: - mongodb branches: