I described model as case class WorkAreaType(name: String)
and findAll method
object WorkAreaType {
import system.db.Mongo.JsonFormats._
def findAll = Await.result(Mongo.workAreaTypes.find(Json.obj()).cursor[WorkAreaType].collect[List](), 3 seconds)
}
JsonFormats:
object JsonFormats {
implicit val workAreaTypeFormat = Json.format[WorkAreaType]
}
Mongo.workAreaTypes is a JSONCollection val workAreaTypes: JSONCollection = db.collection[JSONCollection]("WorkAreaTypes")
How can I read mongo _id object after call WorkAreaType.findAll
in list?