This way libraries like Friend, that use namespaced keywords (::identity) and other
Clojure-specific data structures will work well with Monger.
Current store will strip off namespace information from namespaced keywords
because clojure.core/name work that way. For example: (name ::identity).
Reported by Julio Barros.
Make our own version of DBRef that is exactly like the original but has one extra constructor and
implements clojure.lang.IDeref so it is possible to @dereference such refs.
This is only one small step in a proper, Clojuric, easy to use DBRef support. We may tack more Monger-specific
extensions to our DBRef implementation later.
As sang by Jetallica:
Do unto others as they have done unto you
but what in the hell is this world coming to?
Blow the universe into nothingness
nuclear warfare shall lay us to rest
Fight Java with Java
ending is near
fight Java with Java
bursting with fear
map will work over the cursor itself because it is Iterable. This both avoids silly NPEs and
follows the common sense of finder functions: they must return an empty sequence when there
are no results, not nil.
We don't add it to the change log because the majority of apps won't use it and
it is not an important change between RC1 and RC2 (or what may even be 1.0).
Unfortunately, because Java driver's return type is so generic (Iterable),
we have to do it by type hinting what is really returned as the result set
(by inspecting the Java driver code paths).
We inline collection getter not so much as an optimization technique (HotSpot will inline all that anyway) but
mostly to remove let forms that do not make any difference to the (human) reader.
Monger can now connect to replica sets using one or more seeds when
calling monger.core/connect with a vector (or list) of server-addresses
instead of just a single one.
For example -
;; Connect to a single MongoDB instance
(connect (server-address "127.0.0.1" 27017) (mongo-options))
;; Connect to a replica set
(connect [(server-address "127.0.0.1" 27017)
(server-address "127.0.0.1" 27018)]
(mongo-options))
Since connect! just applies connect to all the args, it works fine there
as well.