Hi all,
I'm happy to announce MongoQuery.
MongoQuery
provides compile time string interpolator to create BSON objects. Both
Casbah and ReactiveMongo are supported. Example:
import com.github.limansky.mongoquery.casbah._
val user = myCollectionDAO.findOne(mq"{ username : $user }")
NOTE: when you need to use '$' for MongoDB keywords you need to escape it with the second '$':
myCollectionDAO.update(mq"{ price : { $$gt : $maxPrice } }",
mq"{ $$set : { price : $maxPrice } }",
false, true)
The release is published to Sonatype repo. To add it to your project add following dependency to your build.sbt:
"com.github.limansky" %% "mongoquery-casbah" % "0.2" // for Casbah users"com.github.limansky" %% "mongoquery-reactive" % "0.2" // for ReactiveMongo user
To get more information check the project readme. https://github.com/limansky/mongoquery
--
Regards,
Mike.