one of my models includes a list of BSONObjectIDs:
case class User(
_id: BSONObjectID = BSONObjectID.generate,
email: String,
favorite_ids: List[BSONObjectID] = List(),
home_folder_id: Option[BSONObjectID] = None
)
unfortunately, the compiler complains with the following message:
No implicit format for List[reactivemongo.bson.BSONObjectID] available.
it complains in the last line of the following snippet.
import play.api.libs.json._
import reactivemongo.bson._
import play.modules.reactivemongo.json.BSONFormats._
import play.modules.reactivemongo.json._, ImplicitBSONHandlers._
import play.modules.reactivemongo.json.collection._
implicit val userFormat = Json.format[User]
Funny observation: the Option[BSONObjectID] is working when i comment the List[] line out.
Anyone know how to include a format for lists? I figured that should be available implicitly.
thanks