Compare commits
10 commits
master
...
1.1.x-stab
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6fa2c07e33 | ||
|
|
d4d7bc5d33 | ||
|
|
0ce67ad3d6 | ||
|
|
eba6b829bf | ||
|
|
acad2dba25 | ||
|
|
0ff1c16ae8 | ||
|
|
b0a9b391ba | ||
|
|
4c59a4eccc | ||
|
|
6ca01e4256 | ||
|
|
7704900b38 |
7 changed files with 60 additions and 31 deletions
31
ChangeLog.md
31
ChangeLog.md
|
|
@ -1,10 +1,31 @@
|
|||
## Changes between 1.0.0-rc1 and 1.1.0
|
||||
## Changes between 1.1.2 and 1.1.3
|
||||
|
||||
No changes yet.
|
||||
|
||||
|
||||
## Changes between 1.1.1 and 1.1.2
|
||||
|
||||
### Eliminated Reflection Warnings in monger.joda-time
|
||||
|
||||
`monger.joda-time` functions no longer result in reflective method calls.
|
||||
|
||||
Contributed by [Baishampayan Ghose](https://github.com/ghoseb).
|
||||
|
||||
|
||||
## Changes between 1.1.0 and 1.1.1
|
||||
|
||||
### monger.collection/insert-and-return no longer forcefully replaces existing document id
|
||||
|
||||
`monger.collection/insert-and-return` now preserves existing document ids, just like `monger.collection/save-and-return` does.
|
||||
|
||||
|
||||
## Changes between 1.1.0-rc1 and 1.1.0
|
||||
|
||||
No changes.
|
||||
|
||||
|
||||
|
||||
## Changes between 1.0.0-beta2 and 1.1.0-rc1
|
||||
## Changes between 1.1.0-beta2 and 1.1.0-rc1
|
||||
|
||||
### monger.collection/save-and-return
|
||||
|
||||
|
|
@ -14,7 +35,7 @@ is to `monger.collection/insert`. See Monger 1.1.0-beta1 changes or function doc
|
|||
|
||||
|
||||
|
||||
## Changes between 1.0.0-beta1 and 1.1.0-beta2
|
||||
## Changes between 1.1.0-beta1 and 1.1.0-beta2
|
||||
|
||||
### Support for passing keywords as collection names
|
||||
|
||||
|
|
@ -23,7 +44,7 @@ For example, `monger.collection/insert-and-return` that's given collection name
|
|||
treat it as `people` (by applying [clojure.core/name](http://clojuredocs.org/clojure_core/clojure.core/name) to the argument).
|
||||
|
||||
|
||||
## Changes between 1.0.0-alpha3 and 1.1.0-beta1
|
||||
## Changes between 1.1.0-alpha3 and 1.1.0-beta1
|
||||
|
||||
### monger.collection/insert-and-return
|
||||
|
||||
|
|
@ -48,7 +69,7 @@ when a user may want to have the write result returned.
|
|||
|
||||
|
||||
|
||||
## Changes between 1.0.0-alpha2 and 1.1.0-alpha3
|
||||
## Changes between 1.1.0-alpha2 and 1.1.0-alpha3
|
||||
|
||||
### Clojure reader extensions
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ definition to your `pom.xml`:
|
|||
|
||||
With Leiningen:
|
||||
|
||||
[com.novemberain/monger "1.1.0"]
|
||||
[com.novemberain/monger "1.1.2"]
|
||||
|
||||
|
||||
With Maven:
|
||||
|
|
@ -61,7 +61,7 @@ With Maven:
|
|||
<dependency>
|
||||
<groupId>com.novemberain</groupId>
|
||||
<artifactId>monger</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(defproject com.novemberain/monger "1.1.0"
|
||||
(defproject com.novemberain/monger "1.1.3-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.0.0"
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
;; and it does not work very well in our case, because that DBObject is short lived and produced
|
||||
;; from the Clojure map we are passing in. Plus, this approach is very awkward with immutable data
|
||||
;; structures being the default. MK.
|
||||
(let [doc (merge document {:_id (ObjectId.)})]
|
||||
(let [doc (merge {:_id (ObjectId.)} document)]
|
||||
(insert db collection doc concern)
|
||||
doc)))
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
;;
|
||||
|
||||
(defmethod print-dup java.util.Date
|
||||
[d out]
|
||||
[^java.util.Date d ^java.io.Writer out]
|
||||
(.write out
|
||||
(str "#="
|
||||
`(java.util.Date. ~(.getYear d)
|
||||
|
|
@ -47,5 +47,5 @@
|
|||
|
||||
|
||||
(defmethod print-dup org.joda.time.base.AbstractInstant
|
||||
[d out]
|
||||
[^org.joda.time.base.AbstractInstant d out]
|
||||
(print-dup (.toDate d) out))
|
||||
|
|
|
|||
|
|
@ -129,6 +129,13 @@
|
|||
(is (:_id result))
|
||||
(is (= 1 (mc/count collection)))))
|
||||
|
||||
(deftest insert-and-return-with-a-provided-id
|
||||
(let [collection "people"
|
||||
oid (ObjectId.)
|
||||
doc {:name "Joe" :age 30 :_id oid}
|
||||
result (mc/insert-and-return :people doc)]
|
||||
(is (= (:_id result) (:_id doc) oid))
|
||||
(is (= 1 (mc/count collection)))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
|||
|
|
@ -15,25 +15,26 @@
|
|||
(use-fixtures :each purge-migrations)
|
||||
|
||||
|
||||
(deftest test-add-migration-id
|
||||
(let [db (mg/get-db "monger-test")
|
||||
coll "meta.migrations"
|
||||
key "1"]
|
||||
(mc/remove db coll {})
|
||||
(is (not (mc/any? db coll {:_id key})))
|
||||
(is (not (contains? (applied-migration-ids db) key)))
|
||||
(add-migration-id db key)
|
||||
(is (mc/any? db coll {:_id key}))
|
||||
(is (contains? (applied-migration-ids db) key))))
|
||||
(when-not (get (System/getenv) "CI")
|
||||
(deftest test-add-migration-id
|
||||
(let [db (mg/get-db "monger-test")
|
||||
coll "meta.migrations"
|
||||
key "1"]
|
||||
(mc/remove db coll {})
|
||||
(is (not (mc/any? db coll {:_id key})))
|
||||
(is (not (contains? (applied-migration-ids db) key)))
|
||||
(add-migration-id db key)
|
||||
(is (mc/any? db coll {:_id key}))
|
||||
(is (contains? (applied-migration-ids db) key))))
|
||||
|
||||
|
||||
(deftest test-remove-migration-id
|
||||
(let [db (mg/get-db "monger-test")
|
||||
coll "meta.migrations"
|
||||
key "1"]
|
||||
(mc/remove db coll {})
|
||||
(add-migration-id db key)
|
||||
(is (mc/any? db coll {:_id key}))
|
||||
(is (contains? (applied-migration-ids db) key))
|
||||
(remove-migration-id db key)
|
||||
(is (not (contains? (applied-migration-ids db) key)))))
|
||||
(deftest test-remove-migration-id
|
||||
(let [db (mg/get-db "monger-test")
|
||||
coll "meta.migrations"
|
||||
key "1"]
|
||||
(mc/remove db coll {})
|
||||
(add-migration-id db key)
|
||||
(is (mc/any? db coll {:_id key}))
|
||||
(is (contains? (applied-migration-ids db) key))
|
||||
(remove-migration-id db key)
|
||||
(is (not (contains? (applied-migration-ids db) key))))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue