Explain that this crap hasn't originated in Monger

We have to cope with the retarded API in MongoDB server and Java driver 2.x.

3.0 is much more sensible, by the way.
This commit is contained in:
Michael Klishin 2015-02-24 08:34:38 +03:00
parent cd4326ca69
commit 525cf985c1

View file

@ -27,6 +27,8 @@
;;
(defn- okayish?
"MongoDB protocol seem to be using 4 distinct values to indicate logical truth.
This function makes dealing with that slightly more manageable."
[value]
(contains? #{true "true" 1 1.0} value))
@ -47,7 +49,7 @@
(okayish? (.get result "ok")))
(has-error?
[^DBObject result]
;; yes, this is exactly the logic MongoDB Java driver uses.
;; yes, really. This is exactly the logic MongoDB Java driver uses.
(> (count (str (.get result "err"))) 0))
(updated-existing?
[^DBObject result]