Packages

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).

Linear Supertypes
Json2BsonConverters, LowPriority1Json2BsonConverters, LowPriority2Json2BsonConverters, LowPriority3Json2BsonConverters, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. json2bson
  2. Json2BsonConverters
  3. LowPriority1Json2BsonConverters
  4. LowPriority2Json2BsonConverters
  5. LowPriority3Json2BsonConverters
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. 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
  17. implicit final def toDocumentReaderConv[T](r: Reads[T])(implicit conv: FromValue): BSONDocumentReader[T]

    Raises a JsError is the JSON value is not a JsObject.

    Raises a JsError is the JSON value is not a JsObject.

    import reactivemongo.play.json.compat.json2bson.toDocumentReaderConv
    
    def lorem[T](jr: play.api.libs.json.Reads[T]) =
      toDocumentReaderConv(jr)
    Definition Classes
    LowPriority3Json2BsonConverters
  18. 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

    toDocumentWriterConv

  19. 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
  20. implicit final def toHandler[T](h: Format[T])(implicit from: FromValue, to: ToValue): BSONHandler[T]
    Definition Classes
    Json2BsonConverters
  21. 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

    toDocumentWriterConv

  22. 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

    toDocumentWriterConv

  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. implicit final def toWriterConv[T](w: Writes[T])(implicit conv: ToValue): BSONWriter[T]
    Definition Classes
    LowPriority3Json2BsonConverters
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Json2BsonConverters

Inherited from LowPriority1Json2BsonConverters

Inherited from LowPriority2Json2BsonConverters

Inherited from LowPriority3Json2BsonConverters

Inherited from AnyRef

Inherited from Any

Ungrouped