ValueConverters

reactivemongo.play.json.compat.ValueConverters$
See theValueConverters companion trait

See compat$ and ValueConverters.

Note that as there is not a JSON equivalent for each BSON value (BSONDateTime, or even distinction between BSON long/int).

So for example, using the default JSON handlers, a same Long property can be written in some documents as BSON long (NumberLong), and in some other as BSON integer (see ValueConverters.toNumber), which is ok to read all these documents, but can impact the MongoDB queries (same for date/time values that will be serialized as BSON string, rather than BSON date/time or timestamp).

Attributes

Companion:
trait
Graph
Supertypes
trait ToValue
trait FromValue
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Inherited types

final type JsonJavaScript = JsObject

Attributes

Inherited from:
ValueConverters
final type JsonNumber = JsNumber

JSON representation for numbers

JSON representation for numbers

Attributes

Inherited from:
ValueConverters
final type JsonObjectID = JsObject

Attributes

Inherited from:
ValueConverters
final type JsonSymbol = JsObject

Attributes

Inherited from:
ValueConverters
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

implicit def fromValue: FromValue
implicit def toValue: ToValue

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 fromDouble(bson: BSONDouble): JsNumber

Attributes

Inherited from:
ValueConverters
final implicit def fromInteger(bson: BSONInteger): JsNumber

Attributes

Inherited from:
ValueConverters
implicit def fromJavaScript(bson: BSONJavaScript): JsObject

See syntax:

See syntax:

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

Attributes

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

See syntax:

See syntax:

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

Attributes

Inherited from:
SharedValueConverters (hidden)
final implicit def fromLong(bson: BSONLong): JsNumber

Attributes

Inherited from:
ValueConverters
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 fromObjectID(bson: BSONObjectID): JsObject

See syntax:

See syntax:

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

Attributes

See also:

dsl.objectID

Inherited from:
ValueConverters
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
final implicit def fromSymbol(bson: BSONSymbol): JsObject

See syntax:

See syntax:

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

Attributes

See also:

dsl.symbol

Inherited from:
ValueConverters
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)