Monger is an idiomatic Clojure MongoDB driver 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.
It also has solid documentation.
2.0.0 is a major backwards-incompatible release that implements in
Monger the major breaking API
changes
announced earlier for several ClojureWerkz projects.
Changes between 1.8.0 and 2.0.0
2.0 is a major release that has breaking public API changes.
Explicit Connection/DB/GridFS Argument
In Monger 2.0, all key public API functions require an explicit
DB/connection/GridFS object to be provided instead of relying on
a shared dynamic var. This makes Monger much easier to use with
systems such as Component and Jig, as well as concurrent
applications that need to work with multiple connections, database,
or GridFS filesystems.
Monger is an idiomatic Clojure MongoDB driver 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.
It also has solid documentation.
1.8.0 is a minor backwards-compatible release that updates MongoDB Java driver
and adds a few minor features. The next release will be 2.0 with some
major breaking API changes that we’ve announced earlier.
Changes between 1.7.0 and 1.8.0
Clojure 1.6
Monger now depends on org.clojure/clojure version 1.6.0. It is
still compatible with Clojure 1.4 and if your project.clj depends on
a different version, it will be used, but 1.6 is the default now.
monger.result Use with WriteConcerns is Deprecated
This means that WriteConcern#getLastError is no longer a safe from concurrency
hazards. Therefore the use of monger.result functions on WriteConcern instances
is now deprecated in MongoDB Java client and Monger.
Welle 2.0 has breaking API changes in clojurewerkz.welle.kv functions.
Changes in K/V Function Return Values
This is a breaking API change.
Welle 2.0 changes how Riak responses are represented as Clojure maps.
Welle now will correctly preserve all vector clocks associated with multiple
siblings in the response and the response itself.
This means that welle.kv/modify will work correctly and won’t make sibling
explosions worse.
The most important part of the change is how responses are represented:
every response is an immutable map that has :result key as well as other
metadata keys (:has-value?, :has-siblings?, :modified?, :content-type and so on).
This contrasts with earlier versions, where results were returned directly by functions
such as welle.kv/fetch, it is now possible to destructure the response in order to
obtain the returned value:
1234
(require'[clojurewerkz.welle.kv:askv])(let [{:keys[result]:asm}(kv/fetchbucket-namek:r1)](comment "Do something with the result"))
Here are the keys that clojurewerkz.welle.kv/fetch returns now for every response:
:result: one or more objects returned by Riak
:vclock: vector clock of the response
:has-siblings?: true if response has siblings
:has-value?: true if response is non-empty
:modified?: false when conditional GET returned a non-modified response
:deleted?: true if this object has been deleted but there is a vclock for it
Clojure 1.3 Support Dropped
Welle no longer supports Clojure 1.3.
Counters Support (Riak 1.4+)
clojurewerkz.welle.counters is a new namespace that provides operations on Riak counters:
While creating a protocol buffer cluster client you can now provide
hosts and ports separated by a colon, e.g. “127.0.0.1:10017”. If a port is not
provided, the default port will be used.
Optional Keywordization of Keys With JSON Serialization
Automatic JSON serialization previously unconditionally converted keys to keywords.
This may be a problem for some projects, because keywords are not garbage collected.
clojurewerkz.welle.conversion/*convert-json-keys-to-keywords* is a new dynamic var that
controls this behavior. When bound to false, automatic JSON serialization won’t convert
keys to keywords.
Now, we can start transforming users the way we want: add, remove fields based on certain conditions.
12345
(updateuser[](add-field:cool-dudetrue);; adds a field :cool-dude with value true(new-path[:age])#(- 2014(:birth-year%));; explicit adding of a new field, calculated from the existing data(new-path[:posts])#(fetch-posts(:name%));; fetching some related data from the DB[:posts:*]#(update-posts%));; apply some transformations to all the fetched posts, if there are any
Queries
Queries are very similar to how you’d query your data with filter in Clojure:
Results are returned in the order they’ve been seen in your data structure, however you should be aware of the
fact that iterating over the hash in Clojure doesn’t guarantee you order.
Path Queries
Path queries are most useful when you’d like to fire a function against some part of your data (be it processing,
database initialization or anything else.
You can also run predicate queries based on your map, for example if you want to configure your database servers
from rather big and complex config:
2.0.0-rc1
is a release candidate of Elastisch 2.0, which focuses on the new
features in ElasticSearch 1.1 and introduces major API improvements,
including a breaking change.
Changes between Elastisch 2.0.0-beta5 and 2.0.0-rc1
Connection/Client As Explicit Argument
Starting with Elastisch 2.0.0-rc1, connection (client) is no longer a shared
dynamic var but rather is an explicit argument that relevant API functions
accept.
Changes between Elastisch 2.0.0-beta2 and 2.0.0-beta3
ElasticSearch Client Update
ElasticSearch client has been upgraded to 1.1.0.
Clojure 1.6
Elastisch now depends on org.clojure/clojure version 1.6.0. It is
still compatible with Clojure 1.4 and if your project.clj depends on
a different version, it will be used, but 1.6 is the default now.
Type Exists Operation
types-exists support
in both rest and native clients:
clojurewerkz.elastisch.aggregation is a new namespace that contains
helper functions that produce various types of aggregations. Just like
clojurewerkz.elastisch.query, all of the functions return maps and
are optional.
clojurewerkz.elastisch.rest.response/aggregations-from is a new function
that returns aggregations from a search response:
Aggregations support is primarily focused on REST client at the moment.
clj-http Update
clj-http dependency has been upgraded to version 0.9.1.
Changes between Elastisch 1.4.0 and 2.0.0-beta1
ElasticSearch 1.0 Compatibility
Main goal of Elastisch 2.0 is ElasticSearch 2.0 compatibility. This includes minor
API changes (in line with ElasticSearch 1.0 API and terminology changes)
and moderate internal modifications.
Support for cluster nodes stats and info REST APIs
clojureworkz.elastisch.rest.admin/nodes-info and clojureworkz.elastisch.rest.admin/nodes-stats
are new administrative functions that provide access to ElasticSearch
cluster stats and node info.
(require'[clojurewerkz.elastisch.rest.document:asdoc])(doc/analyze"foo bar baz")(doc/analyze"foo bar baz":index"some-index-name")(doc/analyze"foo bar baz":analyzer"whitespace")(doc/analyze"foo bar baz":tokenizer"keyword":filters"lowercase")(doc/analyze"foo bar baz":index"some-index-name":field"some-field-name")
Contributed by Joachim De Beule
Query String Escaping
clojurewerkz.elastisch.query/query-string accepts a new option, :escape-with,
which is a function that performs escaping of special characters in query string
queries.
By default clojurewerkz.elastisch.escape/escape-query-string-characters is used.
Contributed by Ben Reinhart (Groupon).
ElasticSearch Native Client Upgrade
Elastisch now depends on ElasticSearch native client version 1.0.1.
clj-http Update
clj-http dependency has been upgraded to version 0.9.0.
3.0.0-rc1 is a release candidate. It has one major breaking API change
compared to 2.0.x: every function now takes a connection record as
an explicit argument instead of relying on a dynamic var.
Changes between Neocons 2.0.0 and 3.0.0
Breaking Change: Explicit Connection Argument
Neocons no longer uses a dynamic var to hold the state of the connection.
This leads to significant changes to the API as the connection has to be
passed to functions. The position of the connection argument is always the
first argument for the sake of consistency:
1234567891011
(require'[clojurewerkz.neocons.rest:asnr])(require'[clojurewerkz.neocons.rest.nodes:asnn]);; with Neocons 2.0(nr/connect!"http://localhost:7476/db")(nn/create{:url"http://clojurewerkz.org/"});; with Neocons 3.0(let [conn(nr/connect"http://localhost:7476/db")](nn/createconn{:url"http://clojurewerkz.org/"}))
Additionally connect! function in clojurewerkz.neocons.rest no longer
exists. This has been replaced by function connect in clojurewerkz.neocons.rest.
The connect function has the same arguments as the connect! function
only it returns a Connection record.
The Connection record has a key called :options which can be used to pass
additional parameters to be used by clj-http
like debug.
Contributed by Rohit Aggarwal.
Clojure 1.6
Neocons now depends on org.clojure/clojure version 1.6.0. It is
still compatible with Clojure 1.4 and if your project.clj depends on
a different version, it will be used, but 1.6 is the default now.
We’d like to thank Rohit Aggarwal for
single-handedly doing all the work in Neocons 3.0. Contributors
like Rohit is why open source software works as well as it does.