object json2bson extends Json2BsonConverters
Implicit conversions for handler types
from play.api.libs.json
to reactivemongo.api.bson
.
import reactivemongo.play.json.compat.json2bson._ def foo[T](jw: play.api.libs.json.OWrites[T]) = { val w: reactivemongo.api.bson.BSONDocumentWriter[T] = jw w }
Note: Importing both json2bson
& bson2json
can lead to diverging implicits in Scala 2.11
(see HandlerConverterSpec211
).
- Alphabetic
- By Inheritance
- json2bson
- Json2BsonConverters
- LowPriority1Json2BsonConverters
- LowPriority2Json2BsonConverters
- LowPriority3Json2BsonConverters
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit final def toDocumentHandlerConv[T](h: OFormat[T])(implicit conv: FromValue): BSONDocumentHandler[T]
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. json2bson.toDocumentHandlerConv def foo[T](jh: play.api.libs.json.OFormat[T]) = { val h: reactivemongo.api.bson.BSONDocumentHandler[T] = jh h }
- Definition Classes
- Json2BsonConverters
- implicit final def toDocumentReaderConv[T](r: Reads[T])(implicit conv: FromValue): BSONDocumentReader[T]
Raises a
JsError
is the JSON value is not aJsObject
.Raises a
JsError
is the JSON value is not aJsObject
.import reactivemongo.play.json.compat.json2bson.toDocumentReaderConv def lorem[T](jr: play.api.libs.json.Reads[T]) = toDocumentReaderConv(jr)
- Definition Classes
- LowPriority3Json2BsonConverters
- implicit final def toDocumentWriter[T](implicit w: OWrites[T], conv: ToValue): BSONDocumentWriter[T]
Provided there is a Play JSON
OWrites
, resolve a document writer.Provided there is a Play JSON
OWrites
, resolve a document writer.import play.api.libs.json.OWrites import reactivemongo.api.bson.BSONDocumentWriter import reactivemongo.play.json.compat.json2bson.toDocumentWriter def foo[T : OWrites]: BSONDocumentWriter[T] = implicitly[BSONDocumentWriter[T]]
- Definition Classes
- LowPriority1Json2BsonConverters
- See also
- implicit final def toDocumentWriterConv[T](w: OWrites[T])(implicit conv: ToValue): BSONDocumentWriter[T]
import reactivemongo.play.json.compat. json2bson.toDocumentWriterConv def foo[T](jw: play.api.libs.json.OWrites[T]) = { val w: reactivemongo.api.bson.BSONDocumentWriter[T] = jw w }
- Definition Classes
- LowPriority1Json2BsonConverters
- implicit final def toHandler[T](h: Format[T])(implicit from: FromValue, to: ToValue): BSONHandler[T]
- Definition Classes
- Json2BsonConverters
- implicit final def toReader[T](implicit r: Reads[T], conv: FromValue): BSONReader[T]
Provided there is a Play JSON
Reads
, resolve a BSON reader.Provided there is a Play JSON
Reads
, resolve a BSON reader.import play.api.libs.json.Reads import reactivemongo.api.bson.BSONReader import reactivemongo.play.json.compat.json2bson.toReader def foo[T: Reads]: BSONReader[T] = implicitly[BSONReader[T]]
- Definition Classes
- LowPriority2Json2BsonConverters
- See also
- implicit final def toReaderConv[T](r: Reads[T])(implicit conv: FromValue): BSONReader[T]
Converts a Play JSON
Reads
to a BSON reader.Converts a Play JSON
Reads
to a BSON reader.import play.api.libs.json.Reads import reactivemongo.api.bson.BSONReader import reactivemongo.play.json.compat.json2bson.toReaderConv def foo[T](implicit r: Reads[T]): BSONReader[T] = r
- Definition Classes
- LowPriority2Json2BsonConverters
- See also
- def toString(): String
- Definition Classes
- AnyRef → Any
- implicit final def toWriterConv[T](w: Writes[T])(implicit conv: ToValue): BSONWriter[T]
- Definition Classes
- LowPriority3Json2BsonConverters
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()