package compat
Implicit conversions for handler & values types
between reactivemongo.bson
and reactivemongo.api.bson
.
import reactivemongo.api.bson.compat._
For more specific imports, see ValueConverters and HandlerConverters .
- Alphabetic
- By Inheritance
- compat
- HandlerConverters
- LowPriorityHandlerConverters1
- LowPriorityHandlerConverters2
- LowPriorityHandlerConverters3
- ValueConverters
- LowPriorityConverters
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait HandlerConverters extends LowPriorityHandlerConverters1
Implicit conversions for handler types between
reactivemongo.bson
andreactivemongo.api.bson
.Implicit conversions for handler types between
reactivemongo.bson
andreactivemongo.api.bson
.import reactivemongo.api.bson.compat.HandlerConverters._ def foo[T](lw: reactivemongo.bson.BSONDocumentWriter[T]) = { val w: reactivemongo.api.bson.BSONDocumentWriter[T] = lw w } import reactivemongo.bson.BSONValue def bar[T](lr: reactivemongo.api.bson.BSONReader[T]) = { val r: reactivemongo.bson.BSONReader[BSONValue, T] = lr r }
- trait ValueConverters extends LowPriorityConverters
Implicit conversions for value types between
reactivemongo.bson
andreactivemongo.api.bson
.Implicit conversions for value types between
reactivemongo.bson
andreactivemongo.api.bson
.// Required import import reactivemongo.api.bson.compat.ValueConverters._ // From legacy reactivemongo.bson import reactivemongo.api.bson.{ BSONDouble, BSONString, BSONValue } val newStr: BSONString = reactivemongo.bson.BSONString("foo") val newVal: BSONValue = reactivemongo.bson.BSONInteger(2) // To legacy val oldStr: reactivemongo.bson.BSONString = BSONString("bar") val oldVal: reactivemongo.bson.BSONValue = BSONDouble(1.2D)
Value Members
- implicit final def fromArray(array: BSONArray): bson.BSONArray
- Definition Classes
- ValueConverters
- implicit final def fromBinary(binary: BSONBinary): bson.BSONBinary
- Definition Classes
- ValueConverters
- implicit final def fromBinarySubtype(subtype: Subtype): bson.Subtype
- Definition Classes
- ValueConverters
- implicit final def fromBoolean(boolean: BSONBoolean): bson.BSONBoolean
- Definition Classes
- ValueConverters
- implicit final def fromDateTime(dateTime: BSONDateTime): bson.BSONDateTime
- Definition Classes
- ValueConverters
- implicit final def fromDecimal(decimal: BSONDecimal): bson.BSONDecimal
- Definition Classes
- ValueConverters
- implicit final def fromDocument(doc: BSONDocument): bson.BSONDocument
- Definition Classes
- ValueConverters
- implicit final def fromDocumentHandler[T](h: BSONDocumentHandler[T]): bson.BSONDocumentHandler[T]
Implicit conversion from new
BSONDocumentHandler
to the legacy API.Implicit conversion from new
BSONDocumentHandler
to the legacy API.import reactivemongo.api.bson.compat.HandlerConverters.fromDocumentHandler def bar[T](lh: reactivemongo.api.bson.BSONDocumentHandler[T]) = { val h: reactivemongo.bson.BSONDocumentHandler[T] = lh h }
- Definition Classes
- HandlerConverters
- implicit final def fromDocumentReader[T](r: BSONDocumentReader[T]): bson.BSONDocumentReader[T]
import reactivemongo.api.bson.compat.HandlerConverters.fromDocumentReader def foo[T](r: reactivemongo.api.bson.BSONDocumentReader[T]) = { val lr: reactivemongo.bson.BSONDocumentReader[T] = r lr }
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def fromDocumentWriter[T](w: BSONDocumentWriter[T]): bson.BSONDocumentWriter[T]
import reactivemongo.api.bson.compat.HandlerConverters.fromDocumentWriter def bar[T](lw: reactivemongo.api.bson.BSONDocumentWriter[T]) = { val w: reactivemongo.bson.BSONDocumentWriter[T] = lw w }
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def fromDouble(double: BSONDouble): bson.BSONDouble
- Definition Classes
- ValueConverters
- implicit final def fromElement(element: BSONElement): bson.BSONElement
- Definition Classes
- ValueConverters
- implicit final def fromHandler[T](h: BSONHandler[T]): bson.BSONHandler[bson.BSONValue, T]
- Definition Classes
- LowPriorityHandlerConverters1
- implicit final def fromInteger(integer: BSONInteger): bson.BSONInteger
- Definition Classes
- ValueConverters
- implicit final def fromJavaScript(javaScript: BSONJavaScript): bson.BSONJavaScript
- Definition Classes
- ValueConverters
- implicit final def fromJavaScriptWS(javaScript: BSONJavaScriptWS): bson.BSONJavaScriptWS
- Definition Classes
- ValueConverters
- implicit final def fromLong(long: BSONLong): bson.BSONLong
- Definition Classes
- ValueConverters
- implicit val fromMaxKey: (BSONMaxKey) => bson.BSONMaxKey.type
- Definition Classes
- ValueConverters
- implicit val fromMinKey: (BSONMinKey) => bson.BSONMinKey.type
- Definition Classes
- ValueConverters
- implicit val fromNull: (BSONNull) => bson.BSONNull.type
- Definition Classes
- ValueConverters
- implicit final def fromObjectID(objectID: BSONObjectID): bson.BSONObjectID
- Definition Classes
- ValueConverters
- implicit final def fromReader[T](r: BSONReader[T]): bson.BSONReader[bson.BSONValue, T]
- Definition Classes
- LowPriorityHandlerConverters3
- implicit final def fromRegex(regex: BSONRegex): bson.BSONRegex
- Definition Classes
- ValueConverters
- implicit final def fromStr(string: BSONString): bson.BSONString
- Definition Classes
- ValueConverters
- implicit final def fromSymbol(symbol: BSONSymbol): bson.BSONSymbol
- Definition Classes
- ValueConverters
- implicit final def fromTimestamp(timestamp: BSONTimestamp): bson.BSONTimestamp
- Definition Classes
- ValueConverters
- implicit val fromUndefined: (BSONUndefined) => bson.BSONUndefined.type
- Definition Classes
- ValueConverters
- implicit final def fromValue(bson: BSONValue): bson.BSONValue
- Definition Classes
- LowPriorityConverters
- implicit final def fromWriter[T](w: BSONWriter[T]): bson.BSONWriter[T, bson.BSONValue]
- Definition Classes
- LowPriorityHandlerConverters3
- final def legacyDocumentHandler[T](implicit r: bson.BSONDocumentReader[T], w: bson.BSONDocumentWriter[T]): bson.BSONDocumentHandler[T]
- Definition Classes
- LowPriorityHandlerConverters1
- implicit def legacyReaderNewValue[B <: BSONValue, L](implicit r: BSONDocumentReader[B], conv: (B) => L): bson.BSONDocumentReader[L]
Based on the compatibility conversions, provides instances of legacy
BSONDocumentReader
for the new BSON value API.Based on the compatibility conversions, provides instances of legacy
BSONDocumentReader
for the new BSON value API.- Definition Classes
- HandlerConverters
- implicit def legacyWriterNewValue[B <: BSONValue, L](implicit w: BSONDocumentWriter[B], conv: (L) => B): bson.BSONDocumentWriter[L]
Based on the compatibility conversions, provides instances of legacy
BSONDocumentWriter
for the new BSON value API.Based on the compatibility conversions, provides instances of legacy
BSONDocumentWriter
for the new BSON value API.- Definition Classes
- HandlerConverters
- final def providedDocumentHandler[T](implicit r: BSONDocumentReader[T], w: BSONDocumentWriter[T]): BSONDocumentHandler[T]
Provided there are both a
BSONDocumentReader
and aBSONDocumentWriter
for the given typeT
, aBSONDocumentHandler
is materialized.Provided there are both a
BSONDocumentReader
and aBSONDocumentWriter
for the given typeT
, aBSONDocumentHandler
is materialized.- Definition Classes
- LowPriorityHandlerConverters1
- implicit final def toArray(legacy: bson.BSONArray): BSONArray
- Definition Classes
- ValueConverters
- implicit final def toBinary(legacy: bson.BSONBinary): BSONBinary
- Definition Classes
- ValueConverters
- implicit final def toBinarySubtype(legacy: bson.Subtype): Subtype
- Definition Classes
- ValueConverters
- implicit final def toBoolean(legacy: bson.BSONBoolean): BSONBoolean
- Definition Classes
- ValueConverters
- implicit final def toDateTime(legacy: bson.BSONDateTime): BSONDateTime
- Definition Classes
- ValueConverters
- implicit final def toDecimal(legacy: bson.BSONDecimal): BSONDecimal
- Definition Classes
- ValueConverters
- implicit final def toDocument(legacy: bson.BSONDocument): BSONDocument
- Definition Classes
- ValueConverters
- implicit final def toDocumentHandler[T](h: bson.BSONDocumentHandler[T]): BSONDocumentHandler[T]
Implicit conversion from legacy
BSONDocumentHandler
to the new API.Implicit conversion from legacy
BSONDocumentHandler
to the new API.import reactivemongo.api.bson.compat.HandlerConverters.toDocumentHandler def foo[T](lh: reactivemongo.bson.BSONDocumentHandler[T]) = { val h: reactivemongo.api.bson.BSONDocumentHandler[T] = lh h }
- Definition Classes
- HandlerConverters
- implicit final def toDocumentReader[T](implicit r: bson.BSONDocumentReader[T]): BSONDocumentReader[T]
Provided there is a legacy document reader, resolve a new one.
Provided there is a legacy document reader, resolve a new one.
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def toDocumentReaderConv[T](r: bson.BSONDocumentReader[T]): BSONDocumentReader[T]
import reactivemongo.api.bson.compat.HandlerConverters.toDocumentReaderConv def lorem[T](lw: reactivemongo.bson.BSONDocumentReader[T]) = { val w: reactivemongo.api.bson.BSONDocumentReader[T] = lw w }
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def toDocumentWriter[T](implicit w: bson.BSONDocumentWriter[T]): BSONDocumentWriter[T]
Provided there is a legacy document writer, resolve a new one.
Provided there is a legacy document writer, resolve a new one.
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def toDocumentWriterConv[T](w: bson.BSONDocumentWriter[T]): BSONDocumentWriter[T]
import reactivemongo.api.bson.compat.HandlerConverters.toDocumentWriterConv def foo[T](lw: reactivemongo.bson.BSONDocumentWriter[T]) = { val w: reactivemongo.api.bson.BSONDocumentWriter[T] = lw w }
- Definition Classes
- LowPriorityHandlerConverters2
- implicit final def toDouble(legacy: bson.BSONDouble): BSONDouble
- Definition Classes
- ValueConverters
- implicit final def toElement(legacy: bson.BSONElement): BSONElement
- Definition Classes
- ValueConverters
- implicit final def toHandler[T, B <: bson.BSONValue](h: bson.BSONHandler[B, T])(implicit bc: ClassTag[B]): BSONHandler[T]
- Definition Classes
- LowPriorityHandlerConverters1
- implicit final def toInteger(legacy: bson.BSONInteger): BSONInteger
- Definition Classes
- ValueConverters
- implicit final def toJavaScript(legacy: bson.BSONJavaScript): BSONJavaScript
- Definition Classes
- ValueConverters
- implicit final def toJavaScriptWS(legacy: bson.BSONJavaScriptWS): BSONJavaScriptWS
- Definition Classes
- ValueConverters
- implicit final def toLong(legacy: bson.BSONLong): BSONLong
- Definition Classes
- ValueConverters
- implicit val toMaxKey: (bson.BSONMaxKey.type) => BSONMaxKey
- Definition Classes
- ValueConverters
- implicit val toMinKey: (bson.BSONMinKey.type) => BSONMinKey
- Definition Classes
- ValueConverters
- implicit val toNull: (bson.BSONNull.type) => BSONNull
- Definition Classes
- ValueConverters
- implicit final def toObjectID(legacy: bson.BSONObjectID): BSONObjectID
- Definition Classes
- ValueConverters
- implicit final def toReader[T, B <: bson.BSONValue](r: bson.BSONReader[B, T])(implicit bc: ClassTag[B]): BSONReader[T]
- Definition Classes
- LowPriorityHandlerConverters3
- implicit final def toRegex(legacy: bson.BSONRegex): BSONRegex
- Definition Classes
- ValueConverters
- implicit final def toStr(legacy: bson.BSONString): BSONString
- Definition Classes
- ValueConverters
- implicit final def toSymbol(legacy: bson.BSONSymbol): BSONSymbol
- Definition Classes
- ValueConverters
- implicit final def toTimestamp(legacy: bson.BSONTimestamp): BSONTimestamp
- Definition Classes
- ValueConverters
- implicit val toUndefined: (bson.BSONUndefined.type) => BSONUndefined
- Definition Classes
- ValueConverters
- implicit final def toValue(legacy: bson.BSONValue): BSONValue
- Definition Classes
- LowPriorityConverters
- implicit final def toWriter[T](w: bson.BSONWriter[T, _ <: bson.BSONValue]): BSONWriter[T]
- Definition Classes
- LowPriorityHandlerConverters3
- object HandlerConverters extends HandlerConverters
See compat$ and HandlerConverters
- object ValueConverters extends ValueConverters
See compat$ and ValueConverters