I\'m learning scala and mongodb at present and using the play! framework, so I\'m making all sorts of mistakes as I get my head around things. Currently I have a scala objec
I have the following
def service() = Action {
// connect
val collection = MongoConnection()("someDB")("someCollection")
// simply convert the result to a string, separating items with a comma
// this string goes inside an "array", and it's ready to hit the road
val json = "[%s]".format(
collection.find(someQuery).toList.mkString(",")
)
Ok(json).as("application/json")
}