Object

reactivemongo.play.json.compat

bson2json

Related Doc: package compat

Permalink

object bson2json extends Bson2JsonConverters

Implicit conversions for handler types from reactivemongo.api.bson to play.api.libs.json .

import reactivemongo.play.json.compat.bson2json._

def bar[T](br: reactivemongo.api.bson.BSONReader[T]) = {
  val r: play.api.libs.json.Reads[T] = br
  r
}

Note: Importing both json2bson & bson2json can lead to diverging implicits in Scala 2.11 (see HandlerConverterSpec211).

Linear Supertypes
Bson2JsonConverters, LowPriority1Bson2JsonConverters, LowPriority2Bson2JsonConverters, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. bson2json
  2. Bson2JsonConverters
  3. LowPriority1Bson2JsonConverters
  4. LowPriority2Bson2JsonConverters
  5. AnyRef
  6. 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. implicit final def fromDocumentHandlerConv[T](h: BSONDocumentHandler[T])(implicit from: FromValue, to: ToValue): OFormat[T]

    Permalink

    Implicit conversion from new BSONDocumentHandler to Play JSON.

    Implicit conversion from new BSONDocumentHandler to Play JSON.

    import reactivemongo.play.json.compat.
      bson2json.fromDocumentHandlerConv
    
    def bar[T](bh: reactivemongo.api.bson.BSONDocumentHandler[T]) = {
      val h: play.api.libs.json.OFormat[T] = bh
      h
    }
    Definition Classes
    Bson2JsonConverters
  10. implicit final def fromDocumentWriter[T](implicit w: BSONDocumentWriter[T], conv: FromValue): OWrites[T]

    Permalink

    Resolves a OWrites provided a BSON document writer is found.

    Resolves a OWrites provided a BSON document writer is found.

    import play.api.libs.json.OWrites
    import reactivemongo.play.json.compat.bson2json
    
    def bar[T: reactivemongo.api.bson.BSONDocumentWriter]: OWrites[T] =
      bson2json.fromDocumentWriter[T]
    Definition Classes
    LowPriority1Bson2JsonConverters
  11. implicit final def fromDocumentWriterConv[T](w: BSONDocumentWriter[T])(implicit conv: FromValue): OWrites[T]

    Permalink

    import reactivemongo.play.json.compat.bson2json.fromDocumentWriterConv
    
    def bar[T](lw: reactivemongo.api.bson.BSONDocumentWriter[T]) = {
      val w: play.api.libs.json.OWrites[T] = lw
      w
    }
    Definition Classes
    LowPriority1Bson2JsonConverters
  12. implicit final def fromHandler[T](h: BSONHandler[T])(implicit from: FromValue, to: ToValue): Format[T]

    Permalink
    Definition Classes
    Bson2JsonConverters
  13. implicit final def fromReader[T](implicit r: BSONReader[T], conv: ToValue): Reads[T]

    Permalink

    Provided there is a BSON reader, a JSON one is resolved.

    Provided there is a BSON reader, a JSON one is resolved.

    import play.api.libs.json.Reads
    import reactivemongo.api.bson.BSONReader
    import reactivemongo.play.json.compat.bson2json.fromReader
    
    def foo[T: BSONReader]: Reads[T] = implicitly[Reads[T]]
    Definition Classes
    LowPriority2Bson2JsonConverters
  14. implicit final def fromReaderConv[T](r: BSONReader[T])(implicit conv: ToValue): Reads[T]

    Permalink
    Definition Classes
    LowPriority2Bson2JsonConverters
  15. implicit final def fromWriter[T](implicit w: BSONWriter[T], conv: FromValue): Writes[T]

    Permalink

    Provided there is a BSON writer, resolves a JSON one.

    Provided there is a BSON writer, resolves a JSON one.

    import play.api.libs.json.Writes
    import reactivemongo.api.bson.BSONWriter
    import reactivemongo.play.json.compat.bson2json.fromWriter
    
    def foo[T: BSONWriter] = implicitly[Writes[T]] // resolve fromWriter
    Definition Classes
    LowPriority2Bson2JsonConverters
  16. implicit final def fromWriterConv[T](w: BSONWriter[T])(implicit conv: FromValue): Writes[T]

    Permalink
    Definition Classes
    LowPriority2Bson2JsonConverters
  17. final def getClass(): Class[_]

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  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 Bson2JsonConverters

Inherited from LowPriority1Bson2JsonConverters

Inherited from LowPriority2Bson2JsonConverters

Inherited from AnyRef

Inherited from Any

Ungrouped