BSONNumberLike

reactivemongo.api.bson.BSONNumberLike
See theBSONNumberLike companion object
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))

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Abstract methods

Converts this number into a Double.

Converts this number into a Double.

Attributes

Converts this number into a Float.

Converts this number into a Float.

Attributes

def toInt: Try[Int]

Converts this number into an Int.

Converts this number into an Int.

Attributes

Converts this number into a Long.

Converts this number into a Long.

Attributes