Handler factory.
Handler factory.
import reactivemongo.api.bson.{ BSONHandler, BSONString } case class Foo(value: String) val foo: BSONHandler[Foo] = BSONHandler( { _ => Foo("value") }, { f: Foo => BSONString(f.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
.