Packages

object BSONHandler

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BSONHandler
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def apply[B <: BSONValue, T](read: (B) => T, write: (T) => B): BSONHandler[B, T]

    Handler factory.

    Handler factory.

    import reactivemongo.bson.{ BSONHandler, BSONString }
    
    case class Foo(value: String)
    
    val foo: BSONHandler[BSONString, Foo] = BSONHandler(
      { read: BSONString => Foo(read.value) },
      { write: Foo => BSONString(write.value) }
    )
  2. implicit def provided[B <: BSONValue, T](implicit writer: BSONWriter[T, B], reader: BSONReader[B, T]): BSONHandler[B, T]

    Returns a BSON handler for a type T, provided there are a writer and a reader for it, both using the same kind of BSONValue.