BSONValue

reactivemongo.api.bson.BSONValue
See theBSONValue companion object
sealed trait BSONValue

A BSON value

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class BSONArray
class BSONBinary
class BSONBoolean
class BSONDateTime
class BSONDecimal
class BSONDocument
class BSONDouble
class BSONInteger
class BSONLong
trait BSONMaxKey
object BSONMaxKey
trait BSONMinKey
object BSONMinKey
trait BSONNull
object BSONNull
class BSONObjectID
class BSONRegex
class BSONString
class BSONSymbol
object BSONUndefined
Show all
Self type

Members list

Value members

Concrete methods

final def asOpt[T](implicit reader: BSONReader[T]): Option[T]

Optionally parses this value as a T one.

Optionally parses this value as a T one.

Attributes

Returns

Some successfully parsed value, or None if fails

import reactivemongo.api.bson.BSONValue
def foo(v: BSONValue): Option[String] = v.asOpt[String]
final def asTry[T](implicit reader: BSONReader[T]): Try[T]

Tries to parse this value as a T one.

Tries to parse this value as a T one.

import scala.util.Try
import reactivemongo.api.bson.BSONValue

def foo(v: BSONValue): Try[String] = v.asTry[String]

Attributes