Packages

trait ValueConverters extends SharedValueConverters with LowPriority1Converters

Implicit conversions for value types between play.api.libs.json and reactivemongo.api.bson.

import play.api.libs.json.JsValue
import reactivemongo.api.bson.BSONValue
import reactivemongo.play.json.compat.ValueConverters._

def foo(v: BSONValue): JsValue =
  implicitly[JsValue](v) // ValueConverters.fromValue

def bar(v: JsValue): BSONValue =
  implicitly[BSONValue](v) // ValueConverters.toValue

Note: Logger reactivemongo.api.play.json.ValueConverters can be used to debug.

Linear Supertypes
LowPriority1Converters, SharedValueConverters, SharedValueConvertersLowPriority1, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValueConverters
  2. LowPriority1Converters
  3. SharedValueConverters
  4. SharedValueConvertersLowPriority1
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  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. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ValueConverters toany2stringadd[ValueConverters] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ValueConverters, B)
    Implicit
    This member is added by an implicit conversion from ValueConverters toArrowAssoc[ValueConverters] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def ensuring(cond: (ValueConverters) => Boolean, msg: => Any): ValueConverters
    Implicit
    This member is added by an implicit conversion from ValueConverters toEnsuring[ValueConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (ValueConverters) => Boolean): ValueConverters
    Implicit
    This member is added by an implicit conversion from ValueConverters toEnsuring[ValueConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): ValueConverters
    Implicit
    This member is added by an implicit conversion from ValueConverters toEnsuring[ValueConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): ValueConverters
    Implicit
    This member is added by an implicit conversion from ValueConverters toEnsuring[ValueConverters] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ValueConverters toStringFormat[ValueConverters] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. implicit def fromArray(bson: BSONArray): JsArray
    Definition Classes
    SharedValueConverters
  17. implicit final def fromBinary(bin: BSONBinary): JsObject

    See syntax:

    See syntax:

    { "$binary": { "base64": "<payload>", "subType": "<t>" } }

    Definition Classes
    SharedValueConverters
  18. implicit final def fromBoolean(bson: BSONBoolean): JsBoolean
    Definition Classes
    SharedValueConverters
  19. implicit final def fromDateTime(bson: BSONDateTime): JsObject

    See syntax:

    See syntax:

    { "$date": { "$numberLong": "<millis>" } }

    Definition Classes
    SharedValueConverters
  20. implicit final def fromDecimal(bson: BSONDecimal): JsObject

    See syntax:

    See syntax:

    { "$numberDecimal": "<number>" }

    Definition Classes
    SharedValueConverters
  21. implicit def fromDocument(bson: BSONDocument): JsObject

    Converts to a JSON object

    Converts to a JSON object

    Definition Classes
    SharedValueConverters
  22. implicit final def fromDouble(bson: BSONDouble): JsNumber
  23. implicit final def fromInteger(bson: BSONInteger): JsNumber
  24. implicit final def fromJavaScript(bson: BSONJavaScript): JsObject

    See syntax:

    See syntax:

    { "$code": "<javascript>" }

    Definition Classes
    SharedValueConverters
  25. implicit final def fromJavaScriptWS(bson: BSONJavaScriptWS): JsObject

    See syntax:

    See syntax:

    { "$code": "<javascript>", "$scope": { } }

    Definition Classes
    SharedValueConverters
  26. implicit final def fromLong(bson: BSONLong): JsNumber
  27. implicit final val fromMaxKey: (BSONMaxKey) => JsObject

    See syntax:

    See syntax:

    { "$maxKey": 1 }

    Definition Classes
    SharedValueConverters
  28. implicit final val fromMinKey: (BSONMinKey) => JsObject

    See syntax:

    See syntax:

    { "$minKey": 1 }

    Definition Classes
    SharedValueConverters
  29. implicit val fromNull: (BSONNull) => JsNull.type
    Definition Classes
    SharedValueConverters
  30. implicit final def fromObject(js: JsObject): BSONValue

    First checks whether an explicit type (e.g.

    First checks whether an explicit type (e.g. $binary) is specified, otherwise converts to a BSON document.

    Definition Classes
    SharedValueConverters
  31. implicit final def fromObjectID(bson: BSONObjectID): JsObject

    See syntax:

    See syntax:

    { "$oid": "<ObjectId bytes>" }

    Definition Classes
    SharedValueConverters
  32. implicit final def fromRegex(rx: BSONRegex): JsObject

    See syntax:

    See syntax:

    { "$regularExpression": { "pattern": "<regexPattern>", "options": "<options>" } }

    Definition Classes
    SharedValueConverters
  33. implicit final def fromStr(bson: BSONString): JsString
    Definition Classes
    SharedValueConverters
  34. implicit final def fromSymbol(bson: BSONSymbol): JsObject

    See syntax:

    See syntax:

    { "$symbol": "<name>" }

    Definition Classes
    SharedValueConverters
  35. implicit final def fromTimestamp(ts: BSONTimestamp): JsObject

    See syntax:

    See syntax:

    { "$timestamp": {"t": <t>, "i": } }`

    Definition Classes
    SharedValueConverters
  36. implicit final val fromUndefined: (BSONUndefined) => JsObject

    See syntax:

    See syntax:

    { "$undefined": true }

    Definition Classes
    SharedValueConverters
  37. implicit final def fromValue(bson: BSONValue): JsValue
    Definition Classes
    LowPriority1Converters
  38. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  39. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  40. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  41. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  42. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  43. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  44. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  45. implicit final def toArray(js: JsArray): BSONArray
    Definition Classes
    SharedValueConverters
  46. implicit final def toBoolean(js: JsBoolean): BSONBoolean
    Definition Classes
    SharedValueConverters
  47. implicit final def toDocument(js: JsObject): BSONDocument

    See toValue

    Definition Classes
    SharedValueConvertersLowPriority1
  48. implicit val toNull: (JsNull.type) => BSONNull
    Definition Classes
    SharedValueConverters
  49. implicit final def toNumber(js: JsNumber): BSONValue

    If the number:

    If the number:

    - is not whole then it's converted to BSON double, - is a valid integer then it's converted to a BSON integer (int32), - otherwise it's converted to a BSON long integer (int64).

    Definition Classes
    SharedValueConverters
  50. implicit final def toStr(js: JsString): BSONValue
    Definition Classes
    SharedValueConverters
  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. implicit final def toValue(js: JsValue): BSONValue
    Definition Classes
    SharedValueConvertersLowPriority1
  53. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  56. object JavaScriptObject

    See syntax

    See syntax

    Definition Classes
    SharedValueConverters
  57. object JavaScriptWSObject

    See syntax

    See syntax

    Definition Classes
    SharedValueConverters

Deprecated Value Members

  1. def [B](y: B): (ValueConverters, B)
    Implicit
    This member is added by an implicit conversion from ValueConverters toArrowAssoc[ValueConverters] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from LowPriority1Converters

Inherited from SharedValueConverters

Inherited from SharedValueConvertersLowPriority1

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromValueConverters to any2stringadd[ValueConverters]

Inherited by implicit conversion StringFormat fromValueConverters to StringFormat[ValueConverters]

Inherited by implicit conversion Ensuring fromValueConverters to Ensuring[ValueConverters]

Inherited by implicit conversion ArrowAssoc fromValueConverters to ArrowAssoc[ValueConverters]

Ungrouped