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) )
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
.