BSONNumberLike

sealed trait BSONNumberLike

A BSON value that can be seen as a number.

Conversions:

import scala.util.Success
import reactivemongo.api.bson.{ BSONNumberLike, BSONDocument, BSONInteger }

val bi = BSONInteger(1)
assert(bi.asTry[BSONNumberLike].flatMap(_.toLong) == Success(1L))

val doc = BSONDocument("field" -> bi)
assert(doc.getAsTry[BSONNumberLike]("field").
 flatMap(_.toDouble) == Success(1D))
Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

Converts this number into a Double.

Converts this number into a Double.

Converts this number into a Float.

Converts this number into a Float.

def toInt: Try[Int]

Converts this number into an Int.

Converts this number into an Int.

Converts this number into a Long.

Converts this number into a Long.