2012-04-29 14:23:28 +00:00
# Monger, a modern Clojure MongoDB Driver
2011-08-04 12:01:26 +00:00
2012-04-29 14:23:28 +00:00
Monger is an idiomatic Clojure MongoDB driver for a more civilized age.
2011-08-04 12:01:26 +00:00
2012-04-29 14:23:28 +00:00
It has batteries included, offers powerful expressive query DSL, strives to support every MongoDB 2.0+ feature and . Monger is built from the
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
* Support most of MongoDB 2.0+ features but only those that really matter. Grouping the way it is done today, for example, does not (it is easier to just use Map/Reduce directly).
* Be well documented.
* Be well tested.
2012-01-30 22:36:43 +00:00
* Be maintained, do not carry technical debt from 2009 forever.
2012-04-10 21:42:07 +00:00
* Target Clojure 1.3.0 and later from the ground up.
2011-11-04 06:26:32 +00:00
* Integrate with libraries like clojure.data.json and Joda Time.
2012-03-07 06:42:08 +00:00
* Provide support for unit testing: factories/fixtures DSL, collection cleaner functions, clojure.test integration and so on.
2012-04-10 21:42:07 +00:00
* Support URI connections to be friendly to Heroku and other PaaS providers.
2011-10-19 15:41:49 +00:00
* Learn from other clients like the Java and Ruby ones.
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-02-26 02:47:17 +00:00
## Community
2012-01-30 23:05:14 +00:00
[Monger has a mailing list ](https://groups.google.com/forum/#!forum/clojure-monger ). Feel free to join it and ask any questions you may have.
2012-02-26 02:47:17 +00:00
To subscribe for announcements of releases, important changes and so on, please follow [@ClojureWerkz ](https://twitter.com/#!/clojurewerkz ) on Twitter.
2012-02-03 22:03:24 +00:00
## Artifacts
2012-02-11 05:57:58 +00:00
### The Most Recent Release
With Leiningen:
2012-04-29 14:23:28 +00:00
[com.novemberain/monger "1.0.0-beta5"]
2012-02-11 05:57:58 +00:00
With Maven:
< dependency >
< groupId > com.novemberain< / groupId >
< artifactId > monger< / artifactId >
2012-04-29 14:23:28 +00:00
< version > 1.0.0-beta5< / version >
2012-02-11 05:57:58 +00:00
< / dependency >
### Snapshots
2012-02-16 21:25:16 +00:00
If you are comfortable with using snapshots, snapshot artifacts are [released to Clojars ](https://clojars.org/com.novemberain/monger ) every 24 hours.
2012-02-03 22:03:24 +00:00
With Leiningen:
[com.novemberain/monger "1.0.0-SNAPSHOT"]
With Maven:
< dependency >
< groupId > com.novemberain< / groupId >
< artifactId > monger< / artifactId >
< version > 1.0.0-SNAPSHOT< / version >
< / dependency >
2012-04-29 14:23:28 +00:00
## Getting Started
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +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-monger ) and ask questions, too!
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
## Documentation & Examples
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
Please visit our [documentation site ](http://clojuremongodb.info/ ). 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-04-29 14:23:28 +00:00
## Supported Clojure versions
2012-01-30 22:32:50 +00:00
2012-04-29 14:23:28 +00:00
Monger is built from the ground up for Clojure 1.3 and up.
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
### Write Performance
Monger insert operations are efficient and have very little overhead compared to the underlying Java driver. Here
are some numbers on a MacBook Pro from fall 2010 with Core i7 and an Intel SSD drive:
```
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
```
2012-04-11 17:01:18 +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-25 14:37:46 +00:00
## Monger Is a ClojureWerkz Project
Neocons is part of the group of libraries known as ClojureWerkz, together with
2012-04-28 17:31:33 +00:00
[Neocons ](https://github.com/michaelklishin/neocons ), [Langohr ](https://github.com/michaelklishin/langohr ), [Elastisch ](https://github.com/clojurewerkz/elastisch ), [Welle ](https://github.com/michaelklishin/welle ), [Quartzite ](https://github.com/michaelklishin/quartzite ) and several others.
2012-02-25 14:37:46 +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
2012-03-13 17:38:42 +00:00
lein2 all 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
2012-02-25 14:37:46 +00:00
Copyright (C) 2011-2012 Michael S. Klishin
2011-08-04 12:01:26 +00:00
2011-10-16 13:03:14 +00:00
Distributed under the [Eclipse Public License ](http://www.eclipse.org/legal/epl-v10.html ), the same as Clojure.