FromValue

sealed trait FromValue

Conversion API from BSON to JSON values

Companion:
object
class Object
trait Matchable
class Any

Type members

Types

type JsonJavaScript <: JsValue
type JsonNumber <: JsValue

JSON representation for numbers

JSON representation for numbers

type JsonObjectID <: JsValue
type JsonSymbol <: JsValue
type JsonTime <: JsValue

JSON representation for temporal types

JSON representation for temporal types

Value members

Abstract methods

def fromBinary(bin: BSONBinary): JsObject
def fromBoolean(bson: BSONBoolean): JsBoolean
def fromDateTime(bson: BSONDateTime): JsonTime
def fromDecimal(bson: BSONDecimal): JsObject

See syntax:

See syntax:

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

def fromDocument(bson: BSONDocument)(implicit conv: FromValue): JsObject

Converts to a JSON object

Converts to a JSON object

def fromDouble(bson: BSONDouble): JsonNumber
def fromInteger(bson: BSONInteger): JsonNumber
def fromJavaScript(bson: BSONJavaScript): JsonJavaScript
def fromJavaScriptWS(bson: BSONJavaScriptWS): JsObject
def fromLong(bson: BSONLong): JsonNumber
def fromObject(js: JsObject): BSONValue

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

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

def fromObjectID(bson: BSONObjectID): JsonObjectID
def fromRegex(rx: BSONRegex): JsObject
def fromSymbol(bson: BSONSymbol): JsonSymbol
def fromTimestamp(ts: BSONTimestamp): JsonTime
def fromValue(bson: BSONValue): JsValue

Implicits

Implicits

final implicit def fromArray(arr: BSONArray): JsArray
final implicit def fromStr(bson: BSONString): JsString

Inherited implicits

final implicit def fromMaxKey(_max: BSONMaxKey): JsObject

See syntax:

See syntax:

{ "$maxKey": 1 }

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

See syntax:

See syntax:

{ "$minKey": 1 }

Inherited from:
FromValueCompat (hidden)
implicit def fromNull(_null: BSONNull): JsNull.type
Inherited from:
FromValueCompat (hidden)
final implicit def fromUndefined(_undef: BSONUndefined): JsObject

See syntax:

See syntax:

{ "$undefined": true }

Inherited from:
FromValueCompat (hidden)