I have the following code that works in a console app when referencing \"org.reactivemongo\" %% \"play2-reactivemongo\" % \"0.10.5.0.akka23\"
when I upd
The final release of ReactiveMongo 0.11 has been published ("org.reactivemongo" %% "play2-reactivemongo" % "0.11.0.play23"
).
As indicated on the updated documentation, for the default BSON/JSON conversions, it's recommended to have: import play.modules.reactivemongo.json._, ImplicitBSONHandlers._
.
Mine worked out after adding: import play.modules.reactivemongo.json._ import play.modules.reactivemongo.json.collection._
In my case, I was feeding ReactiveMongo (insert
) with a JsValue
instead than a JsObject
. In order to fix it, behind adding import play.modules.reactivemongo.json._
, I also had to change my implicit Writes
in OWrites
:
from
implicit val myWrites: Writes[A] = new Writes[A] {
def writes(a: A) = Json.obj(...)
to
implicit val myWrites: OWrites[A] = new OWrites[A] { <-- NOTE THE 'O' before 'Writes'
def writes(a: A) = Json.obj(...)
try to add
import reactivemongo.play.json._
For me adding this import worked.
import play.modules.reactivemongo.json._