ValueConverters

reactivemongo.play.json.compat.ValueConverters
See theValueConverters companion object

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.

Attributes

Companion:
object
Graph
Supertypes
trait ToValue
trait FromValue
class Object
trait Matchable
class Any
Known subtypes
object ValueConverters.type

Members list

Concise view

Type members

Types

final type JsonJavaScript = JsObject
final type JsonNumber = JsNumber

JSON representation for numbers

JSON representation for numbers

Attributes

final type JsonObjectID = JsObject
final type JsonSymbol = JsObject

Inherited types

type JsonTime = JsObject

Attributes

Inherited from:
TemporalObjectConverters (hidden)

Value members

Inherited methods

final protected def jsonJavaScript(bson: BSONJavaScript): JsObject

Attributes

Inherited from:
SharedValueConverters (hidden)

Implicits

Implicits

final implicit def fromDouble(bson: BSONDouble): JsNumber
final implicit def fromInteger(bson: BSONInteger): JsNumber
implicit def fromJavaScript(bson: BSONJavaScript): JsObject

See syntax:

See syntax:

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

Attributes

final implicit def fromLong(bson: BSONLong): JsNumber
final implicit def fromObjectID(bson: BSONObjectID): JsObject

See syntax:

See syntax:

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

Attributes

See also:

dsl.objectID

final implicit def fromSymbol(bson: BSONSymbol): JsObject

See syntax:

See syntax:

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

Attributes

See also:

dsl.symbol

Inherited implicits

final implicit def fromArray(arr: BSONArray): JsArray

Attributes

Inherited from:
FromValue
final implicit def fromBinary(bin: BSONBinary): JsObject

See syntax:

See syntax:

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

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromBoolean(bson: BSONBoolean): JsBoolean

Attributes

Inherited from:
SharedValueConverters (hidden)
implicit def fromDateTime(bson: BSONDateTime): JsObject

See syntax:

See syntax:

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

Attributes

Inherited from:
TemporalObjectConverters (hidden)
final implicit def fromDecimal(bson: BSONDecimal): JsObject

Attributes

Inherited from:
SharedValueConverters (hidden)
implicit def fromDocument(bson: BSONDocument)(implicit conv: FromValue): JsObject

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromJavaScriptWS(bson: BSONJavaScriptWS): JsObject

See syntax:

See syntax:

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

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromMaxKey(_max: BSONMaxKey): JsObject

See syntax:

See syntax:

{ "$maxKey": 1 }

Attributes

Inherited from:
FromValueCompat (hidden)
final implicit def fromMinKey(_min: BSONMinKey): JsObject

See syntax:

See syntax:

{ "$minKey": 1 }

Attributes

Inherited from:
FromValueCompat (hidden)
implicit def fromNull(_null: BSONNull): JsNull.type

Attributes

Inherited from:
FromValueCompat (hidden)
final implicit def fromObject(js: JsObject): BSONValue

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromRegex(rx: BSONRegex): JsObject

See syntax:

See syntax:

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

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromStr(bson: BSONString): JsString

Attributes

Inherited from:
FromValue
implicit def fromTimestamp(ts: BSONTimestamp): JsObject

See syntax:

See syntax:

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

Attributes

Inherited from:
TemporalObjectConverters (hidden)
final implicit def fromUndefined(_undef: BSONUndefined): JsObject

See syntax:

See syntax:

{ "$undefined": true }

Attributes

Inherited from:
FromValueCompat (hidden)
final implicit def fromValue(bson: BSONValue): JsValue

Attributes

Inherited from:
LowPriority1Converters (hidden)
final implicit def toArray(arr: JsArray): BSONArray

Attributes

Inherited from:
ToValue
final implicit def toBoolean(js: JsBoolean): BSONBoolean

Attributes

Inherited from:
ToValue
final implicit def toDocument(js: JsObject): BSONDocument

Attributes

Inherited from:
SharedValueConvertersLowPriority1 (hidden)
final implicit def toJsValueWrapper[T <: BSONValue](value: T): JsValueWrapper

Attributes

Inherited from:
ToValue
final implicit def toNull(_null: JsNull.type): BSONNull

Attributes

Inherited from:
ToValueCompat (hidden)
final implicit def toNumber(js: JsNumber): BSONValue

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def toStr(js: JsString): BSONValue

Attributes

Inherited from:
ToValue
final implicit def toValue(js: JsValue): BSONValue

Attributes

Inherited from:
SharedValueConvertersLowPriority1 (hidden)