reactivemongo.api.bson.msb

Implicit conversions for handler & values types between org.bson and reactivemongo.api.bson .

import scala.reflect.ClassTag

import reactivemongo.api.bson.BSONWriter
import reactivemongo.api.bson.msb._

def writerToEncoder[T](w: BSONWriter[T])(implicit ct: ClassTag[T]) = {
 // ClassTag required for generics

 val enc: org.bson.codecs.Encoder[T] = w
 enc
}

// From org.bson
import reactivemongo.api.bson.{ BSONDouble, BSONString, BSONValue }

val newStr: BSONString = new org.bson.BsonString("foo")
val newVal: BSONValue = new org.bson.BsonInt32(2)

// To org.bson
val oldStr: org.bson.BsonString = BSONString("bar")
val oldVal: org.bson.BsonValue = BSONDouble(1.2D)

For more specific imports, see ValueConverters and HandlerConverters .

Type members

Classlikes

Implicit conversions for handler types between org.bson and reactivemongo.api.bson .

Implicit conversions for handler types between org.bson and reactivemongo.api.bson .

import reactivemongo.api.bson.msb.HandlerConverters._

def foo[T](enc: org.bson.codecs.Encoder[T]) = {
 val w: reactivemongo.api.bson.BSONWriter[T] = enc
 w
}

def bar[T](lr: reactivemongo.api.bson.BSONReader[T]) = {
 val dec: org.bson.codecs.Decoder[T] = lr
 dec
}
Companion:
object

Implicit conversions for value types between org.bson and reactivemongo.api.bson.

Implicit conversions for value types between org.bson and reactivemongo.api.bson.

// Required import
import reactivemongo.api.bson.msb.ValueConverters._

// From org.bson
import reactivemongo.api.bson.{ BSONDouble, BSONString, BSONValue }

val newStr: BSONString = new org.bson.BsonString("foo")
val newVal: BSONValue = new org.bson.BsonInt32(2)

// To org.bson
val oldStr: org.bson.BsonString = BSONString("bar")
val oldVal: org.bson.BsonValue = BSONDouble(1.2D)
Companion:
object

Inherited classlikes

object DefaultCodecRegistry extends CodecRegistry
Inherited from:
HandlerConverters

Value members

Inherited methods

final def toDecimal(dec: Decimal128): BSONDecimal
Inherited from:
ValueConverters
final def toObjectID(boid: ObjectId): BSONObjectID
Inherited from:
ValueConverters

Inherited fields

val codeToBinSubtype: Byte => Subtype
Inherited from:
ValueConverters

Implicits

Inherited implicits

final implicit def fromArray(array: BSONArray): BsonArray
Inherited from:
ValueConverters
final implicit def fromBinary(binary: BSONBinary): BsonBinary
Inherited from:
ValueConverters
final implicit def fromBinarySubtype(subtype: Subtype): BsonBinarySubType
Inherited from:
ValueConverters
final implicit def fromBoolean(boolean: BSONBoolean): BsonBoolean
Inherited from:
ValueConverters
final implicit def fromDateTime(dateTime: BSONDateTime): BsonDateTime
Inherited from:
ValueConverters
final implicit def fromDecimal(decimal: BSONDecimal): BsonDecimal128
Inherited from:
ValueConverters
final implicit def fromDocument(doc: BSONDocument): BsonDocument
Inherited from:
ValueConverters
final implicit def fromDouble(double: BSONDouble): BsonDouble
Inherited from:
ValueConverters
final implicit def fromElement(element: BSONElement): BsonElement
Inherited from:
ValueConverters
final implicit def fromHandler[T](h: BSONHandler[T])(implicit tt: ClassTag[T], cr: CodecRegistry): Codec[T]
Inherited from:
HandlerConverters
final implicit def fromInteger(integer: BSONInteger): BsonInt32
Inherited from:
ValueConverters
final implicit def fromJavaScript(javaScript: BSONJavaScript): BsonJavaScript
Inherited from:
ValueConverters
final implicit def fromJavaScriptWS(js: BSONJavaScriptWS): BsonJavaScriptWithScope
Inherited from:
ValueConverters
final implicit def fromLong(long: BSONLong): BsonInt64
Inherited from:
ValueConverters
implicit def fromMaxKey(_v: BSONMaxKey): BsonMaxKey
Inherited from:
ValueConvertersCompat
implicit def fromMinKey(_v: BSONMinKey): BsonMinKey
Inherited from:
ValueConvertersCompat
implicit def fromNull(_v: BSONNull): BsonNull
Inherited from:
ValueConvertersCompat
final implicit def fromObjectID(oid: BSONObjectID): BsonObjectId
Inherited from:
ValueConverters
final implicit def fromReader[T](r: BSONReader[T])(implicit cr: CodecRegistry): Decoder[T]
Inherited from:
LowPriorityHandlerConverters1
final implicit def fromRegex(regex: BSONRegex): BsonRegularExpression
Inherited from:
ValueConverters
final implicit def fromStr(string: BSONString): BsonString
Inherited from:
ValueConverters
final implicit def fromSymbol(symbol: BSONSymbol): BsonSymbol
Inherited from:
ValueConverters
final implicit def fromTimestamp(timestamp: BSONTimestamp): BsonTimestamp
Inherited from:
ValueConverters
implicit def fromUndefined(_v: BSONUndefined): BsonUndefined
Inherited from:
ValueConvertersCompat
final implicit def fromValue(bson: BSONValue): BsonValue
Inherited from:
LowPriorityConverters
final implicit def fromWriter[T](w: BSONWriter[T])(implicit tt: ClassTag[T]): Encoder[T]
Inherited from:
LowPriorityHandlerConverters1
final implicit def toArray(bson: BsonArray): BSONArray
Inherited from:
ValueConverters
final implicit def toBinary(bson: BsonBinary): BSONBinary
Inherited from:
ValueConverters
final implicit def toBinarySubtype(bson: BsonBinarySubType): Subtype
Inherited from:
ValueConverters
final implicit def toBoolean(bson: BsonBoolean): BSONBoolean
Inherited from:
ValueConverters
final implicit def toDateTime(bson: BsonDateTime): BSONDateTime
Inherited from:
ValueConverters
final implicit def toDecimal(bson: BsonDecimal128): BSONDecimal
Inherited from:
ValueConverters
final implicit def toDocument(bson: BsonDocument): BSONDocument
Inherited from:
ValueConverters
final implicit def toDouble(bson: BsonDouble): BSONDouble
Inherited from:
ValueConverters
final implicit def toElement(bson: BsonElement): BSONElement
Inherited from:
ValueConverters
final implicit def toHandler[T](h: Codec[T]): BSONHandler[T]
Inherited from:
HandlerConverters
final implicit def toInteger(bson: BsonInt32): BSONInteger
Inherited from:
ValueConverters
final implicit def toJavaScript(bson: BsonJavaScript): BSONJavaScript
Inherited from:
ValueConverters
final implicit def toJavaScriptWS(bson: BsonJavaScriptWithScope): BSONJavaScriptWS
Inherited from:
ValueConverters
final implicit def toLong(bson: BsonInt64): BSONLong
Inherited from:
ValueConverters
implicit def toMaxKey(_v: BsonMaxKey): BSONMaxKey
Inherited from:
ValueConvertersCompat
implicit def toMinKey(_v: BsonMinKey): BSONMinKey
Inherited from:
ValueConvertersCompat
implicit def toNull(_v: BsonNull): BSONNull
Inherited from:
ValueConvertersCompat
final implicit def toObjectID(boid: BsonObjectId): BSONObjectID
Inherited from:
ValueConverters
final implicit def toReader[T](dec: Decoder[T]): BSONReader[T]
Inherited from:
LowPriorityHandlerConverters1
final implicit def toRegex(bson: BsonRegularExpression): BSONRegex
Inherited from:
ValueConverters
final implicit def toStr(bson: BsonString): BSONString
Inherited from:
ValueConverters
final implicit def toSymbol(bson: BsonSymbol): BSONSymbol
Inherited from:
ValueConverters
final implicit def toTimestamp(bson: BsonTimestamp): BSONTimestamp
Inherited from:
ValueConverters
implicit def toUndefined(_v: BsonUndefined): BSONUndefined
Inherited from:
ValueConvertersCompat
final implicit def toValue(bson: BsonValue): BSONValue
Inherited from:
LowPriorityConverters
final implicit def toWriter[T](enc: Encoder[T]): BSONWriter[T]
Inherited from:
LowPriorityHandlerConverters1