zenexity/Play-ReactiveMongo — pull request #30 by leon (2013-05-17 09:09:37+00:00)
Title: Feature mongo collection

Using Reactive Mongo Coast to Coast works great, but I've been working on simplifying when you want to work with case classes, mainly because passing around case classes to akka Actors and sub systems feels better than sending JsObject.

By implicitly passing a MongoCollection to a controller we can get a simple crud app up and running in a few minutes.

I have not incorporated the ResourceController and MongoResourceController because I'm not shure they belong in Reactive Mongo (though the could, since they are quite light) but since alot of people have their own ideas about what http verbs to use and they use different front end systems, maybe it's better to have it in the docs, or an sample app.

Here are all the files anyway, and the way the routes are setup now, they nicely integrate with angularjs.
https://gist.github.com/leon/5597895

One thing I'm not shure about is being able to do queries without specifying Json.obj see
https://github.com/leon/Play-ReactiveMongo/commit/57b5478a8db3e5e0dad57624f405951e1a34956b#L0R52
It's nice to be able to do collection.query("name" -> "Leon", "active" -> true) but we then loose the option to do sorting, but maybe we could get something nice out of it.