Compare commits

...

5 commits

Author SHA1 Message Date
Michael Klishin
701e593a9e 3.0.2 2016-01-10 23:43:07 +03:00
Michael Klishin
e215aa0c9c Update change log 2016-01-10 23:42:57 +03:00
Michael Klishin
14b76bbb45 Upgrade Java client to 3.2.0 2016-01-10 23:42:13 +03:00
Michael Klishin
838a58be3a Back to snapshot 2016-01-10 12:59:00 +03:00
Stijn Opheide
5b92e4cb4e Fix cursor hinting
The .hint method should be applied on the cursor object instead
of the DBObject contained in the hint field.
2016-01-10 12:58:48 +03:00
4 changed files with 21 additions and 11 deletions

View file

@ -1,3 +1,14 @@
## Changes between 3.0.1 and 3.0.2
### MongoDB Java Driver Update
MongoDB Java driver dependency has been updated to `3.2.0`.
### Cursor Hinting Option Fix
Contributed by Stijn Opheide.
## Changes between 3.0.0 and 3.0.1
### Authencation Function No Longer Ignores Credentials

View file

@ -1,11 +1,11 @@
(defproject com.novemberain/monger "3.0.1"
(defproject com.novemberain/monger "3.0.2"
: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"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.mongodb/mongodb-driver "3.0.4"]
[org.mongodb/mongodb-driver "3.2.0"]
[clojurewerkz/support "1.1.0"]]
:test-selectors {:default (fn [m]
(and (not (:performance m))

View file

@ -106,7 +106,7 @@
(when snapshot
(.snapshot cursor))
(when hint
(.hint (to-db-object hint)))
(.hint cursor (to-db-object hint)))
(when read-preference
(.setReadPreference cursor read-preference))
(when options

View file

@ -13,14 +13,12 @@
(let [collection "libraries"]
(mc/drop-indexes db collection)
(mc/create-index db collection {"language" 1})
(is (= "language_"
(is (= "language_1"
(:name (second (mc/indexes-on db collection)))))
(mc/drop-indexes db collection)
(mc/create-index db collection ["language"])
(mc/drop-index db collection {"language" 1})
(is (nil? (second (mc/indexes-on db collection))))
(mc/ensure-index db collection (array-map "language" 1) {:unique true})
(is (= "language_"
(is (= "language_1"
(:name (second (mc/indexes-on db collection)))))
(mc/drop-indexes db collection)
(mc/ensure-index db collection (array-map "language" 1))
@ -32,17 +30,18 @@
(deftest ^{:indexing true :time-consuming true} test-ttl-collections
(let [coll "recent_events"
ttl 30
sleep 120]
ttl 15
sleep 65]
(mc/remove db coll)
(mc/drop-indexes db coll)
(mc/ensure-index db coll (array-map :created-at 1) {:expireAfterSeconds ttl})
(dotimes [i 100]
(mc/insert db coll {:type "signup" :created-at (-> i seconds ago) :i i}))
(dotimes [i 100]
(mc/insert db coll {:type "signup" :created-at (-> i seconds from-now) :i i}))
(is (= 200 (mc/count db coll {:type "signup"})))
;; sleep for 65 seconds. MongoDB 2.1.2 seems to run TTLMonitor once per minute, according to
;; the log. MK.
;; sleep for > 60 seconds. MongoDB seems to run TTLMonitor once per minute, according to
;; the log.
(println (format "Now sleeping for %d seconds to test TTL collections!" sleep))
(Thread/sleep (* sleep 1000))
(println (format "Documents in the TTL collection: %d" (mc/count db coll {:type "signup"})))