reactivemongo.play.json.compat
Implicit conversion from new BSONDocumentHandler
to Play JSON.
Implicit conversion from new BSONDocumentHandler
to Play JSON.
import reactivemongo.play.json.compat.HandlerConverters.fromDocumentHandler def bar[T](bh: reactivemongo.api.bson.BSONDocumentHandler[T]) = { val h: play.api.libs.json.OFormat[T] = bh h }
import reactivemongo.play.json.compat.HandlerConverters.fromDocumentReader def foo[T](r: reactivemongo.api.bson.BSONDocumentReader[T]) = { val jr: play.api.libs.json.Reads[T] = r jr }
import reactivemongo.play.json.compat.HandlerConverters.fromDocumentWriter def bar[T](lw: reactivemongo.api.bson.BSONDocumentWriter[T]) = { val w: play.api.libs.json.OWrites[T] = lw w }
Based on the compatibility conversions,
provides instances of Play JSON Reads
for the new BSON value API.
Based on the compatibility conversions,
provides instances of Play JSON Reads
for the new BSON value API.
Based on the compatibility conversions,
provides instances of Play JSON OWrites
for the new BSON value API.
Based on the compatibility conversions,
provides instances of Play JSON OWrites
for the new BSON value API.
Implicit conversion from Play JSON OFormat
to the BSON API.
Implicit conversion from Play JSON OFormat
to the BSON API.
import reactivemongo.play.json.compat.HandlerConverters.toDocumentHandler def foo[T](jh: play.api.libs.json.OFormat[T]) = { val h: reactivemongo.api.bson.BSONDocumentHandler[T] = jh h }
Provided there is a Play JSON Reads
, resolve a new one.
Provided there is a Play JSON Reads
, resolve a new one.
import reactivemongo.play.json.compat.HandlerConverters.toDocumentReaderConv def lorem[T](jr: play.api.libs.json.Reads[T]) = { val w: reactivemongo.api.bson.BSONDocumentReader[T] = jr w }
Provided there is a Play JSON OWrites
, resolve a new one.
Provided there is a Play JSON OWrites
, resolve a new one.
import reactivemongo.play.json.compat.HandlerConverters.toDocumentWriterConv def foo[T](jw: play.api.libs.json.OWrites[T]) = { val w: reactivemongo.api.bson.BSONDocumentWriter[T] = jw w }
See compat$ and HandlerConverters