ANN: Mongoika, a new Clojure MongoDB library

287 views
Skip to first unread message

Tokusei NOBORIO

unread,
Jul 17, 2012, 6:46:34 AM7/17/12
to clo...@googlegroups.com
Hi everyone,

I want to introduce Mongoika. Mongoika is a MongoDB library for Clojure.

We have used this library for a few projects, and have found it easy
to use and efficient. For this release we have fixed a few bugs from
our prototype, and it is now production ready.

Mongoika simplifies building queries. Queries behave like lazy
sequences. Basic GridFS operations are also supported.

The features of Mongoika are:

1) Queries as lazy sequences.

You can easily use Clojure stream idioms, such as method chaining, with MongoDB.

2) Maps as a property of a query.

The map-after function allows you to add a function that modify the
records returned by a query (like "map") without losing the ability to
add further mongodb query specifications.

E.g.:

(defn user-from-mongodb
; code to convert a mogodb record to a domain obect
)

; Create a query that returns all users as domain objects
(defn users [] (map-after user-from-mongodb :users))

; Now you can apply mongodb query specifications to this query,
; even though it doesn't return mongodb records.
(defn fred (fetch-one (users :name "fred")))

3) GridFS support

Supports insert! insert-multi! and delete!

Check out the details at:
https://github.com/yuushimizu/Mongoika

--
Tokusei(@tnoborio)
http://nyampass.com

Michael Klishin

unread,
Jul 21, 2012, 10:27:33 AM7/21/12
to clo...@googlegroups.com
PublicFarley:
Looks very nicely designed. Thanks for contributing. Have you taken a look at other libraries such as CongoMongo (https://github.com/aboekhoff/congomongo/)? How does Mongoika compare?

I am also curious if you have seen Monger (http://clojuremongodb.info) before starting Mongoika.

Monger also lets you work with query cursors as lazy sequences,
uses Mongo shell "syntax" for queries with maps and supports a variety of GridFS operations.
Plus it is the only MongoDB Clojure client with solid documentation.

MK

charlie

unread,
Jul 21, 2012, 1:16:32 PM7/21/12
to clo...@googlegroups.com
Off topic, who did the artwork for  http://clojuremongodb.info/  ?

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Michael Klishin

unread,
Jul 21, 2012, 2:35:49 PM7/21/12
to clo...@googlegroups.com
charlie:

> Off topic, who did the artwork for http://clojuremongodb.info/ ?

A friend of another clojurewerkz.org founder/contributor. More of his artwork:
http://www.flickr.com/photos/zuk13

MK

mic...@defprotocol.org

signature.asc

Tokusei NOBORIO

unread,
Jul 30, 2012, 8:12:12 PM7/30/12
to clo...@googlegroups.com
> Have you taken a look
> at other libraries such as CongoMongo

I used CongoMongo in the past, And decided I need a library with more features.
This is why I wrote Mongoika.

> Monger also lets you work with query cursors as lazy sequences,
> uses Mongo shell "syntax" for queries with maps and supports a variety of
> GridFS operations.

I had not seen Monger before. I have looked at it just now.
It seems to be more mature than Mongoika.

Here is a comparison of the features of the three libraries.
I hope people will correct any mistakes, and point out any important
features I have forgotten.

https://docs.google.com/spreadsheet/ccc?key=0AjcJV_bAT0m_dHVPY0lZZlZvbElyVGZqNFF4bzJJVnc#gid=0

Sean Corfield

unread,
Jul 30, 2012, 9:49:27 PM7/30/12
to clo...@googlegroups.com
On Mon, Jul 30, 2012 at 5:12 PM, Tokusei NOBORIO <t.no...@gmail.com> wrote:
> Here is a comparison of the features of the three libraries.
> I hope people will correct any mistakes, and point out any important
> features I have forgotten.
>
> https://docs.google.com/spreadsheet/ccc?key=0AjcJV_bAT0m_dHVPY0lZZlZvbElyVGZqNFF4bzJJVnc#gid=0

CongoMongo definitely supports:
* WriteConcern
* GridFS
* Map-Reduce

Not sure what you mean by several other categories so it's hard to
tell whether CongoMongo supports them or not.
Multiple Connections? Depending on how you define this, CongoMongo may
well qualify.
Connection Pool? CongoMongo uses the Java driver which does connection
pooling internally already.
Indexing? CongoMongo has add-index! and drop-index! and can retrieve
indexes on a collection.
Heroku? Pretty sure folks are using CongoMongo on Heroku but I can't
confirm that.

CongoMongo's readme doesn't list a lot of the stuff it does but you
can see tests for most of the things mentioned above here:

https://github.com/aboekhoff/congomongo/blob/master/test/somnium/test/congomongo.clj

Hope that helps?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

Sean Corfield

unread,
Jul 30, 2012, 9:53:48 PM7/30/12
to clo...@googlegroups.com
On Mon, Jul 30, 2012 at 5:12 PM, Tokusei NOBORIO <t.no...@gmail.com> wrote:
> I used CongoMongo in the past, And decided I need a library with more features.

What features were missing? Always interested in making CongoMongo
better - since there's a whole team of contributors :)

> It seems to be more mature than Mongoika.

FWIW, CongoMongo has been around since October 2009.

Tokusei NOBORIO

unread,
Jul 30, 2012, 10:14:17 PM7/30/12
to clo...@googlegroups.com
Thank you for explaining this to me. I didn't know that CongoMongo
had these features.
I have updated the feature comparison spreadsheet. Is it okay now?

Does CongoMongo have anything like Mongoika's map-after feature?
https://github.com/yuushimizu/Mongoika

2012/7/31 Sean Corfield <seanco...@gmail.com>:
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



--
登尾 徳誠(Tokusei Noborio) {
ニャンパス株式会社: http://nyampass.com/
ニコ生: http://com.nicovideo.jp/community/co1281759
Blog: http://tnoborio.blogspot.com/
Twitter: http://twitter.com/tnoborio
}

Sean Corfield

unread,
Jul 31, 2012, 12:09:55 AM7/31/12
to clo...@googlegroups.com
On Mon, Jul 30, 2012 at 7:14 PM, Tokusei NOBORIO <t.no...@gmail.com> wrote:
> I have updated the feature comparison spreadsheet. Is it okay now?

Thanx. It's still says 'n' for connection pooling - but that's built
into the Java driver that CongoMongo uses so I'm not sure how you're
defining that feature?

> Does CongoMongo have anything like Mongoika's map-after feature?
> https://github.com/yuushimizu/Mongoika

No, because it does not have a query DSL. It seems to me that a query
DSL, composable queries and map-after are all facets of one feature -
if you don't have a query DSL, you're not going to have any of the
other things...?

Bruce Durling

unread,
Jul 31, 2012, 4:30:07 AM7/31/12
to clo...@googlegroups.com

Congomongo works fine on heroku. You do have to parse the connection url yourself though (or at least you did)

Sean Corfield

unread,
Jul 31, 2012, 1:56:55 PM7/31/12
to clo...@googlegroups.com
On Tue, Jul 31, 2012 at 1:30 AM, Bruce Durling <b...@otfrom.com> wrote:
> Congomongo works fine on heroku. You do have to parse the connection url
> yourself though (or at least you did)

0.1.10 was just released to Clojars and includes support for standard
MongoDB URIs which should address that I believe?

Bruce Durling

unread,
Jul 31, 2012, 3:47:40 PM7/31/12
to clo...@googlegroups.com
Sean,

On Tue, Jul 31, 2012 at 6:56 PM, Sean Corfield <seanco...@gmail.com> wrote:
> On Tue, Jul 31, 2012 at 1:30 AM, Bruce Durling <b...@otfrom.com> wrote:
>> Congomongo works fine on heroku. You do have to parse the connection url
>> yourself though (or at least you did)
>
> 0.1.10 was just released to Clojars and includes support for standard
> MongoDB URIs which should address that I believe?

Great news. I've used congomongo and monger successfully with MongoHQ
on Heroku. I've been very happy with both.

cheers,
Bruce

--
@otfrom | CTO & co-founder @MastodonC | mastodonc.com
Reply all
Reply to author
Forward
0 new messages