Object

reactivemongo.play.json.compat

json2bson

Related Doc: package compat

Permalink

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

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. implicit final def toDocumentHandlerConv[T](h: OFormat[T])(implicit conv: FromValue): BSONDocumentHandler[T]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink
    Definition Classes
    Json2BsonConverters
  21. implicit final def toReader[T](implicit r: Reads[T], conv: FromValue): BSONReader[T]

    Permalink

    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]

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  24. implicit final def toWriterConv[T](w: Writes[T])(implicit conv: ToValue): BSONWriter[T]

    Permalink
    Definition Classes
    LowPriority3Json2BsonConverters
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Json2BsonConverters

Inherited from LowPriority1Json2BsonConverters

Inherited from LowPriority2Json2BsonConverters

Inherited from LowPriority3Json2BsonConverters

Inherited from AnyRef

Inherited from Any

Ungrouped