Returns a BSON array with the given values appended.
Returns a BSON array with the values of the given one appended.
Returns a BSON array with the given value prepended.
Optionally parses this value as a T
one.
Optionally parses this value as a T
one.
Some
successfully parsed value, or None
if fails
import scala.util.Try import reactivemongo.api.bson.BSONValue def foo(v: BSONValue): Option[String] = v.asOpt[String]
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]
The code indicating the BSON type for this value
Returns the BSONValue at the given index
.
Returns the BSONValue at the given index
.
If there is no such index
, or if the matching value
cannot be deserialized returns None
.
the index to be found in the array
Returns the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
Returns the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
If there is no matching value, or the value could not be deserialized,
or converted, returns a None
.
the index to be found in the array
Gets the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
Gets the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
If there is no matching value, or the value could not be deserialized,
or converted, returns a Failure
.
The Failure
holds a exceptions.BSONValueNotFoundException
if the index could not be found.
the index to be found in the array
Gets the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
Gets the BSONValue at the given index
,
and converts it with the given implicit BSONReader.
If there is no matching value, Success(None)
is returned.
If there is a value, it must be valid or a Failure
is returned.
the index to be found in the array
The first/mandatory value, if any
Indicates whether this array is empty
Indicates whether this array is empty
The number of values
The number of values
A
BSONArray
structure (BSON type0x04
).A
BSONArray
is a indexed sequence of BSONValue.