Rogue: A Scala Type-Safe MongoDB DSL 2012-06-22
Recently our group has been debating about switching to MongoDB. As a number of our analysis tools are written in Scala, naturally we'd like a Scala or Java ORM.
After some search, we've decided to explore Rogue, a type-safe DSL for querying MongoDB. Here's some motivation from the Foursquare engineers for developing Rogue, after using Lift for their ORM:
Essentially, we found the querying support a bit too expressive — you can pass in a query object that doesn’t represent a valid query, or query against fields that aren’t part of the record. And in addition it isn’t very type-safe. You can ask for, say, all Venue records where mayor = “Bob”, and it happily executes that query for you, returning nothing, never informing you that the mayor field is not a String but a Long representing the ID of the user. Well, we thought we could use the Scala type system to prevent this from ever happening, and that’s what we set out to do.