I have a case class like:
case class House(id: Int, name: String, meta: Any)
I get this compile error:
implicit not found for 'House.value': reactivemongo.api.bson.BSONReader[Any]
I tried creating a custom BSONReader like:
implicit object anyBSONReader extends BSONReader[Any] {
override def readTry(bson: BSONValue): Try[Any] = bson.asTry[Any].map(v => v.asInstanceOf[Any]).toOption
}
I then imported this anyBSONReader that like this:
case class House(id: Int, name: String, meta: Any)
object House {
implicit object anyBSONReader extends BSONReader[Any] {
override def readTry(bson: BSONValue): Try[Any] = bson.asTry[Any].map(v =>
v.asInstanceOf[Any])
}
implicit val houseHander = Macros.hander[House]
}
I still get the same error message