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. Monger is built from the ground up for Clojure 1.3+ and sits on top of the official MongoDB Java driver.
There is one MongoDB client for Clojure that has been around since 2009. So, why create another one? Monger authors wanted a client that will
- Support most of MongoDB 2.0+ features, focus on those that really matter.
- Be well documented.
- Be well tested.
- Target Clojure 1.3.0 and later from the ground up.
- Be as close to the Mongo shell query language as practical
- Integrate with libraries like Joda Time, Cheshire, clojure.data.json, Ragtime.
- Support URI connections to be friendly to Heroku and other PaaS providers.
- Not carry technical debt from 2009 forever.
Monger is not a young project: started in July 2011, it is over 2 years old with active production use from week 1.
Monger artifacts are released to
Clojars. If you are using
Maven, add the following repository definition to your
<repository> <id>clojars.org</id> <url>http://clojars.org/repo</url> </repository>
<dependency> <groupId>com.novemberain</groupId> <artifactId>monger</artifactId> <version>1.7.0</version> </dependency>
Our test suite also has many code examples.
Monger has a mailing list. Feel free to join it and ask any questions you may have.
To subscribe for announcements of releases, important changes and so on, please follow @ClojureWerkz on Twitter.
Monger requires Clojure 1.4+. The most recent stable release is highly recommended.
Monger is efficient and has very little overhead compared to the underlying Java driver. Here is one (very unscientific) benchmark on a MacBook Pro from mid-2010 with Core i7 and an Intel SSD drive:
Testing monger.test.stress Inserting 1000 documents... "Elapsed time: 25.699 msecs" Inserting 10000 documents... "Elapsed time: 135.069 msecs" Inserting 100000 documents... "Elapsed time: 515.969 msecs"
SAFE write concern, it takes roughly 0.5 second to insert
100,000 documents with Clojure 1.3.0.
Monger uses Leiningen 2. Make sure you have it installed and then run tests against supported Clojure versions using
lein2 all do clean, javac, test
Then create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request on Github.
Copyright (C) 2011-2014 Michael S. Klishin