2012-04-29 14:23:28 +00:00
# Monger, a modern Clojure MongoDB Driver
2011-08-04 12:01:26 +00:00
2012-07-25 08:57:23 +00:00
Monger is an idiomatic [Clojure MongoDB driver ](http://clojuremongodb.info ) for a more civilized age.
2011-08-04 12:01:26 +00:00
2012-06-14 12:56:10 +00:00
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
2012-04-29 14:23:28 +00:00
ground up for Clojure 1.3+ and sits on top of the official MongoDB Java driver.
2012-01-30 22:36:09 +00:00
2011-09-10 16:28:13 +00:00
2011-10-19 15:32:55 +00:00
## Project Goals
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
2012-08-29 13:47:05 +00:00
* Support most of MongoDB 2.0+ features, focus on those that really matter.
2012-05-14 06:19:17 +00:00
* Be [well documented ](http://clojuremongodb.info ).
2012-07-29 19:44:42 +00:00
* Be [well tested ](https://github.com/michaelklishin/monger/tree/master/test/monger/test ).
2012-04-10 21:42:07 +00:00
* Target Clojure 1.3.0 and later from the ground up.
2012-07-29 19:44:42 +00:00
* Be as close to the Mongo shell query language as practical
2012-09-06 21:10:35 +00:00
* Integrate with libraries like Joda Time, [Cheshire ](https://github.com/dakrone/cheshire ), clojure.data.json, [Ragtime ](https://github.com/weavejester/ragtime ).
2012-04-10 21:42:07 +00:00
* Support URI connections to be friendly to Heroku and other PaaS providers.
2012-08-29 13:47:05 +00:00
* Not carry technical debt from 2009 forever.
2012-04-10 21:42:07 +00:00
* Integrate usage of JavaScript files and ClojureScript (as soon as the compiler gets artifact it is possible to depend on for easy embedding).
2011-10-19 15:32:55 +00:00
2011-12-31 00:39:58 +00:00
2012-05-21 11:46:08 +00:00
## Project Maturity
2013-08-17 13:55:15 +00:00
Monger is not a young project: started in July 2011, it is over 2
years old with active production use from week 1.
2012-05-21 11:46:08 +00:00
2012-02-03 22:03:24 +00:00
## Artifacts
2013-08-17 13:55:15 +00:00
Monger artifacts are [released to
Clojars](https://clojars.org/com.novemberain/monger). If you are using
Maven, add the following repository definition to your `pom.xml` :
2012-02-11 05:57:58 +00:00
2012-06-09 08:12:37 +00:00
``` xml
< repository >
< id > clojars.org< / id >
< url > http://clojars.org/repo< / url >
< / repository >
```
2012-02-11 05:57:58 +00:00
2012-06-09 08:12:37 +00:00
### The Most Recent Release
2012-02-03 22:03:24 +00:00
With Leiningen:
2014-05-09 21:14:08 +00:00
[com.novemberain/monger "1.8.0"]
2012-02-03 22:03:24 +00:00
With Maven:
< dependency >
< groupId > com.novemberain< / groupId >
< artifactId > monger< / artifactId >
2014-05-09 21:14:08 +00:00
< version > 1.8.0< / version >
2012-02-03 22:03:24 +00:00
< / dependency >
2012-06-09 08:12:37 +00:00
2012-04-29 14:23:28 +00:00
## Getting Started
2012-01-30 22:32:50 +00:00
2013-08-17 13:55:15 +00:00
Please refer to our [Getting Started
guide](http://clojuremongodb.info/articles/getting_started.html). Don't
hesitate to join our [mailing
list](https://groups.google.com/forum/#!forum/clojure-mongodb) and ask
questions, too!
2012-01-30 22:32:50 +00:00
2013-08-17 13:55:15 +00:00
## Documentation & Examples
2012-01-30 22:32:50 +00:00
2013-08-17 13:55:15 +00:00
Please see our [documentation guides
site](http://clojuremongodb.info/) and [API
reference](http://reference.clojuremongodb.info).
2012-01-30 22:32:50 +00:00
2013-08-17 13:55:15 +00:00
Our [test
suite](https://github.com/michaelklishin/monger/tree/master/test/monger/test)
also has many code examples.
2012-01-30 22:32:50 +00:00
2012-07-29 19:44:42 +00:00
2013-08-17 13:55:15 +00:00
## Community
[Monger has a mailing
list](https://groups.google.com/forum/#!forum/clojure-mongodb). Feel
free to join it and ask any questions you may have.
2012-01-30 22:32:50 +00:00
2013-08-17 13:55:15 +00:00
To subscribe for announcements of releases, important changes and so
on, please follow [@ClojureWerkz ](https://twitter.com/#!/clojurewerkz )
on Twitter.
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
## Supported Clojure versions
2012-01-30 22:32:50 +00:00
2014-01-11 10:21:16 +00:00
Monger requires Clojure 1.4+. The most recent
2013-08-17 13:55:15 +00:00
stable release is highly recommended.
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
## Continuous Integration Status
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
[](http://travis-ci.org/michaelklishin/monger)
2012-01-30 22:32:50 +00:00
2012-07-29 19:44:42 +00:00
## Monger Is a ClojureWerkz Project
Monger is part of the [group of Clojure libraries known as ClojureWerkz ](http://clojurewerkz.org ), together with
2013-07-07 12:03:57 +00:00
[Cassaforte ](http://clojurecassandra.info ), [Langohr ](http://clojurerabbitmq.info ), [Elastisch ](http://clojureelasticsearch.info ), [Titanium ](http://titanium.clojurewerkz.org ), [Quartzite ](http://clojurequartz.info ) and several others.
2012-07-29 19:44:42 +00:00
2013-08-17 13:56:52 +00:00
## Baseline Performance
2012-01-30 22:32:50 +00:00
2013-08-17 13:56:52 +00:00
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:
2012-01-30 22:32:50 +00:00
```
Testing monger.test.stress
Inserting 1000 documents...
2012-04-11 17:01:18 +00:00
"Elapsed time: 25.699 msecs"
Inserting 10000 documents...
"Elapsed time: 135.069 msecs"
Inserting 100000 documents...
"Elapsed time: 515.969 msecs"
2012-01-30 22:32:50 +00:00
```
2013-08-17 13:56:52 +00:00
With the `SAFE` write concern, it takes roughly 0.5 second to insert
100,000 documents with Clojure 1.3.0.
2012-01-30 22:32:50 +00:00
2012-02-03 22:03:24 +00:00
## Development
2012-01-30 21:52:50 +00:00
2012-03-13 17:38:42 +00:00
Monger uses [Leiningen 2 ](https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md ). Make sure you have it installed and then run tests against
2012-04-10 12:15:05 +00:00
supported Clojure versions using
2011-09-10 16:28:13 +00:00
2013-03-20 00:11:16 +00:00
lein2 all do clean, javac, test
2011-10-09 12:56:10 +00:00
2012-02-03 22:03:24 +00:00
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.
2011-10-09 12:56:10 +00:00
2011-09-08 20:27:49 +00:00
2011-08-04 12:01:26 +00:00
## License
2013-12-31 14:17:39 +00:00
Copyright (C) 2011-2014 [Michael S. Klishin ](http://twitter.com/michaelklishin )
2011-08-04 12:01:26 +00:00
2013-04-04 19:51:46 +00:00
Double licensed under the [Eclipse Public License ](http://www.eclipse.org/legal/epl-v10.html ) (the same as Clojure) or
the [Apache Public License 2.0 ](http://www.apache.org/licenses/LICENSE-2.0.html ).
2013-12-18 10:05:08 +00:00
[](https://bitdeli.com/free "Bitdeli Badge")