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.
- Alphabetic
- By Inheritance
- ValueConverters
- LowPriority1Converters
- SharedValueConverters
- SharedValueConvertersLowPriority1
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- 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
- 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()
- 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()
- 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
- 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
- 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
- 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
- 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])
- 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()
- implicit def fromArray(bson: BSONArray): JsArray
- Definition Classes
- SharedValueConverters
- implicit final def fromBinary(bin: BSONBinary): JsObject
See syntax:
See syntax:
{ "$binary": { "base64": "<payload>", "subType": "<t>" } }
- Definition Classes
- SharedValueConverters
- implicit final def fromBoolean(bson: BSONBoolean): JsBoolean
- Definition Classes
- SharedValueConverters
- implicit final def fromDateTime(bson: BSONDateTime): JsObject
See syntax:
See syntax:
{ "$date": { "$numberLong": "<millis>" } }
- Definition Classes
- SharedValueConverters
- implicit final def fromDecimal(bson: BSONDecimal): JsObject
See syntax:
See syntax:
{ "$numberDecimal": "<number>" }
- Definition Classes
- SharedValueConverters
- implicit def fromDocument(bson: BSONDocument): JsObject
Converts to a JSON object
Converts to a JSON object
- Definition Classes
- SharedValueConverters
- implicit final def fromDouble(bson: BSONDouble): JsNumber
- implicit final def fromInteger(bson: BSONInteger): JsNumber
- implicit final def fromJavaScript(bson: BSONJavaScript): JsObject
See syntax:
See syntax:
{ "$code": "<javascript>" }
- Definition Classes
- SharedValueConverters
- implicit final def fromJavaScriptWS(bson: BSONJavaScriptWS): JsObject
See syntax:
See syntax:
{ "$code": "<javascript>", "$scope": { } }
- Definition Classes
- SharedValueConverters
- implicit final def fromLong(bson: BSONLong): JsNumber
- implicit final val fromMaxKey: (BSONMaxKey) => JsObject
See syntax:
See syntax:
{ "$maxKey": 1 }
- Definition Classes
- SharedValueConverters
- implicit final val fromMinKey: (BSONMinKey) => JsObject
See syntax:
See syntax:
{ "$minKey": 1 }
- Definition Classes
- SharedValueConverters
- implicit val fromNull: (BSONNull) => JsNull.type
- Definition Classes
- SharedValueConverters
- 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
- implicit final def fromObjectID(bson: BSONObjectID): JsObject
See syntax:
See syntax:
{ "$oid": "<ObjectId bytes>" }
- Definition Classes
- SharedValueConverters
- implicit final def fromRegex(rx: BSONRegex): JsObject
See syntax:
See syntax:
{ "$regularExpression": { "pattern": "<regexPattern>", "options": "<options>" } }
- Definition Classes
- SharedValueConverters
- implicit final def fromStr(bson: BSONString): JsString
- Definition Classes
- SharedValueConverters
- implicit final def fromSymbol(bson: BSONSymbol): JsObject
See syntax:
See syntax:
{ "$symbol": "<name>" }
- Definition Classes
- SharedValueConverters
- implicit final def fromTimestamp(ts: BSONTimestamp): JsObject
See syntax:
See syntax:
{ "$timestamp": {"t": <t>, "i": } }`
- Definition Classes
- SharedValueConverters
- implicit final val fromUndefined: (BSONUndefined) => JsObject
See syntax:
See syntax:
{ "$undefined": true }
- Definition Classes
- SharedValueConverters
- implicit final def fromValue(bson: BSONValue): JsValue
- Definition Classes
- LowPriority1Converters
- 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 toArray(js: JsArray): BSONArray
- Definition Classes
- SharedValueConverters
- implicit final def toBoolean(js: JsBoolean): BSONBoolean
- Definition Classes
- SharedValueConverters
- implicit final def toDocument(js: JsObject): BSONDocument
See toValue
See toValue
- Definition Classes
- SharedValueConvertersLowPriority1
- implicit val toNull: (JsNull.type) => BSONNull
- Definition Classes
- SharedValueConverters
- 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
- implicit final def toStr(js: JsString): BSONValue
- Definition Classes
- SharedValueConverters
- def toString(): String
- Definition Classes
- AnyRef → Any
- implicit final def toValue(js: JsValue): BSONValue
- Definition Classes
- SharedValueConvertersLowPriority1
- 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()
- object JavaScriptObject
See syntax
See syntax
- Definition Classes
- SharedValueConverters
- object JavaScriptWSObject
See syntax
See syntax
- Definition Classes
- SharedValueConverters
Deprecated Value Members
- 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.