trait BSONDocumentHandler[T] extends BSONDocumentReader[T] with BSONDocumentWriter[T] with BSONHandler[T]
Reads and writers T
values to/from BSONDocument.
- Companion:
- object
trait BSONHandler[T]
trait BSONDocumentWriter[T]
trait BSONWriter[T]
trait BSONDocumentReader[T]
trait BSONReader[T]
class Object
trait Matchable
class Any
object Handler.type
Value members
Concrete methods
@SuppressWarnings(scala.Array.apply[java.lang.String]("AsInstanceOf")(scala.reflect.ClassTag.apply[java.lang.String](classOf[java.lang.String])))
- Definition Classes
Inherited methods
Tries to produce an instance of T
from the document
.
Tries to produce an instance of T
from the document
.
import scala.util.Try
import reactivemongo.api.bson.{ BSONDocument, BSONDocumentReader }
def fromBSON[T](document: BSONDocument)(
implicit r: BSONDocumentReader[T]): Try[T] = r.readTry(document)
- Inherited from:
- BSONDocumentReader
Tries to produce an instance of T
from the bson
value,
returns None
if an error occurred.
Tries to produce an instance of T
from the bson
value,
returns None
if an error occurred.
import reactivemongo.api.bson.{ BSONReader, BSONValue }
def fromBSON[T](bson: BSONValue)(implicit r: BSONReader[T]): Option[T] =
r.readOpt(bson)
- Inherited from:
- BSONReader
Tries to produce an instance of T
from the bson
value,
returns the default
value if an error occurred.
Tries to produce an instance of T
from the bson
value,
returns the default
value if an error occurred.
import reactivemongo.api.bson.{ BSONReader, BSONValue }
def fromBSON[T](bson: BSONValue, v: T)(implicit r: BSONReader[T]): T =
r.readOrElse(bson, v)
- Inherited from:
- BSONReader