TL;DR
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 this year.
Changes between 1.8.0 and 2.0.0
2.0.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.
In other words, instead of
1 2 3 |
|
it is now necessary to do
1 2 3 |
|
This also means that monger.core/connect!
and
monger.core/connect-via-uri!
were removed, as was
monger.multi
namespaces.
To connect to MongoDB, use monger.core/connect
:
1 2 3 |
|
or monger.core/connect-via-uri
:
1 2 3 |
|
To get a database reference, use monger.core/get-db
, which now requires a connection
object:
1 2 3 4 |
|
Options as Maps
Functions that take options now require a proper Clojure map instead of pseudo keyword arguments:
1 2 3 4 5 |
|
Change Log
Monger change log is available on GitHub.
Monger is a ClojureWerkz Project
Monger is part of the group of libraries known as ClojureWerkz, together with
- Langohr, a Clojure client for RabbitMQ that embraces the AMQP 0.9.1 model
- Cassaforte, a Clojure Cassandra client built around CQL
- Elastisch, a minimalistic Clojure client for ElasticSearch
- Welle, a Riak client with batteries included
- Neocons, a client for the Neo4J REST API
- Quartzite, a powerful scheduling library
and several others. If you like Monger, you may also like our other projects.
Let us know what you think on Twitter or on the Clojure mailing list.
About the Author
@michaelklishin on behalf of the ClojureWerkz Team