sql >> Base de Datos >  >> NoSQL >> MongoDB

Reactivemongo serializando un mapa en un BSONDocument

El límite del parámetro de tipo genérico para BSONValue en ValueMapWriter la definición no es correcta. Si cambias la línea

implicit def ValueMapWriter[V](implicit vw: BSONWriter[V, BSONValue]): BSONDocumentWriter[Map[String, V]] =

con

implicit def ValueMapWriter[V](implicit vw: BSONWriter[V, _ <: BSONValue]): BSONDocumentWriter[Map[String, V]] =

entonces debería resolver el escritor implícito para Int.

Por cierto simple-reactivemongo ya hace esto. Y también planeo agregar esta funcionalidad a ReactiveMongo Extensions .