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 .

Attributes

Members list

Type members

Classlikes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

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
}

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

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)

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Inherited classlikes

object DefaultCodecRegistry extends CodecRegistry

Attributes

Inherited from:
HandlerConverters
Supertypes
trait CodecRegistry
class Object
trait Matchable
class Any

Value members

Inherited methods

final def toDecimal(dec: Decimal128): BSONDecimal

Attributes

Inherited from:
ValueConverters
final def toObjectID(boid: ObjectId): BSONObjectID

Attributes

Inherited from:
ValueConverters

Inherited fields

val codeToBinSubtype: Byte => Subtype

Attributes

Inherited from:
ValueConverters

Implicits

Inherited implicits

final implicit def fromArray(array: BSONArray): BsonArray

Attributes

Inherited from:
ValueConverters
final implicit def fromBinary(binary: BSONBinary): BsonBinary

Attributes

Inherited from:
ValueConverters
final implicit def fromBinarySubtype(subtype: Subtype): BsonBinarySubType

Attributes

Inherited from:
ValueConverters
final implicit def fromBoolean(boolean: BSONBoolean): BsonBoolean

Attributes

Inherited from:
ValueConverters
final implicit def fromDateTime(dateTime: BSONDateTime): BsonDateTime

Attributes

Inherited from:
ValueConverters
final implicit def fromDecimal(decimal: BSONDecimal): BsonDecimal128

Attributes

Inherited from:
ValueConverters
final implicit def fromDocument(doc: BSONDocument): BsonDocument

Attributes

Inherited from:
ValueConverters
final implicit def fromDouble(double: BSONDouble): BsonDouble

Attributes

Inherited from:
ValueConverters
final implicit def fromElement(element: BSONElement): BsonElement

Attributes

Inherited from:
ValueConverters
final implicit def fromHandler[T](h: BSONHandler[T])(implicit tt: ClassTag[T], cr: CodecRegistry): Codec[T]

Attributes

Inherited from:
HandlerConverters
final implicit def fromInteger(integer: BSONInteger): BsonInt32

Attributes

Inherited from:
ValueConverters
final implicit def fromJavaScript(javaScript: BSONJavaScript): BsonJavaScript

Attributes

Inherited from:
ValueConverters
final implicit def fromJavaScriptWS(js: BSONJavaScriptWS): BsonJavaScriptWithScope

Attributes

Inherited from:
ValueConverters
final implicit def fromLong(long: BSONLong): BsonInt64

Attributes

Inherited from:
ValueConverters
implicit def fromMaxKey(_v: BSONMaxKey): BsonMaxKey

Attributes

Inherited from:
ValueConvertersCompat (hidden)
implicit def fromMinKey(_v: BSONMinKey): BsonMinKey

Attributes

Inherited from:
ValueConvertersCompat (hidden)
implicit def fromNull(_v: BSONNull): BsonNull

Attributes

Inherited from:
ValueConvertersCompat (hidden)
final implicit def fromObjectID(oid: BSONObjectID): BsonObjectId

Attributes

Inherited from:
ValueConverters
final implicit def fromReader[T](r: BSONReader[T])(implicit cr: CodecRegistry): Decoder[T]

Attributes

Inherited from:
LowPriorityHandlerConverters1 (hidden)
final implicit def fromRegex(regex: BSONRegex): BsonRegularExpression

Attributes

Inherited from:
ValueConverters
final implicit def fromStr(string: BSONString): BsonString

Attributes

Inherited from:
ValueConverters
final implicit def fromSymbol(symbol: BSONSymbol): BsonSymbol

Attributes

Inherited from:
ValueConverters
final implicit def fromTimestamp(timestamp: BSONTimestamp): BsonTimestamp

Attributes

Inherited from:
ValueConverters
implicit def fromUndefined(_v: BSONUndefined): BsonUndefined

Attributes

Inherited from:
ValueConvertersCompat (hidden)
final implicit def fromValue(bson: BSONValue): BsonValue

Attributes

Inherited from:
LowPriorityConverters (hidden)
final implicit def fromWriter[T](w: BSONWriter[T])(implicit tt: ClassTag[T]): Encoder[T]

Attributes

Inherited from:
LowPriorityHandlerConverters1 (hidden)
final implicit def toArray(bson: BsonArray): BSONArray

Attributes

Inherited from:
ValueConverters
final implicit def toBinary(bson: BsonBinary): BSONBinary

Attributes

Inherited from:
ValueConverters
final implicit def toBinarySubtype(bson: BsonBinarySubType): Subtype

Attributes

Inherited from:
ValueConverters
final implicit def toBoolean(bson: BsonBoolean): BSONBoolean

Attributes

Inherited from:
ValueConverters
final implicit def toDateTime(bson: BsonDateTime): BSONDateTime

Attributes

Inherited from:
ValueConverters
final implicit def toDecimal(bson: BsonDecimal128): BSONDecimal

Attributes

Inherited from:
ValueConverters
final implicit def toDocument(bson: BsonDocument): BSONDocument

Attributes

Inherited from:
ValueConverters
final implicit def toDouble(bson: BsonDouble): BSONDouble

Attributes

Inherited from:
ValueConverters
final implicit def toElement(bson: BsonElement): BSONElement

Attributes

Inherited from:
ValueConverters
final implicit def toHandler[T](h: Codec[T]): BSONHandler[T]

Attributes

Inherited from:
HandlerConverters
final implicit def toInteger(bson: BsonInt32): BSONInteger

Attributes

Inherited from:
ValueConverters
final implicit def toJavaScript(bson: BsonJavaScript): BSONJavaScript

Attributes

Inherited from:
ValueConverters
final implicit def toJavaScriptWS(bson: BsonJavaScriptWithScope): BSONJavaScriptWS

Attributes

Inherited from:
ValueConverters
final implicit def toLong(bson: BsonInt64): BSONLong

Attributes

Inherited from:
ValueConverters
implicit def toMaxKey(_v: BsonMaxKey): BSONMaxKey

Attributes

Inherited from:
ValueConvertersCompat (hidden)
implicit def toMinKey(_v: BsonMinKey): BSONMinKey

Attributes

Inherited from:
ValueConvertersCompat (hidden)
implicit def toNull(_v: BsonNull): BSONNull

Attributes

Inherited from:
ValueConvertersCompat (hidden)
final implicit def toObjectID(boid: BsonObjectId): BSONObjectID

Attributes

Inherited from:
ValueConverters
final implicit def toReader[T](dec: Decoder[T]): BSONReader[T]

Attributes

Inherited from:
LowPriorityHandlerConverters1 (hidden)
final implicit def toRegex(bson: BsonRegularExpression): BSONRegex

Attributes

Inherited from:
ValueConverters
final implicit def toStr(bson: BsonString): BSONString

Attributes

Inherited from:
ValueConverters
final implicit def toSymbol(bson: BsonSymbol): BSONSymbol

Attributes

Inherited from:
ValueConverters
final implicit def toTimestamp(bson: BsonTimestamp): BSONTimestamp

Attributes

Inherited from:
ValueConverters
implicit def toUndefined(_v: BsonUndefined): BSONUndefined

Attributes

Inherited from:
ValueConvertersCompat (hidden)
final implicit def toValue(bson: BsonValue): BSONValue

Attributes

Inherited from:
LowPriorityConverters (hidden)
final implicit def toWriter[T](enc: Encoder[T]): BSONWriter[T]

Attributes

Inherited from:
LowPriorityHandlerConverters1 (hidden)