The document fields as a sequence of BSONElements.
The first/mandatory element, if any
Indicates whether this document is empty
Creates a new BSONDocument containing all the elements of this one and the specified element sequence.
Returns the BSONDocument containing all the elements of this one and the elements of the given document.
Creates a new BSONDocument containing all the elements of this one and the specified element producers.
Creates a new BSONDocument containing all the elements of this one and the specified element producers.
Returns a set without the values corresponding to the specified keys.
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
The code indicating the BSON type for this value
Checks whether the given key is found in this element set.
Checks whether the given key is found in this element set.
the key to be found in the document
true if the key is found
Returns the BSONValue associated with the given key
.
Returns the BSONValue associated with the given key
.
If the key cannot be found, returns None
.
the key to be found in the document
Returns the BSONValue associated with the given key
,
and converts it with the given implicit BSONReader.
Returns the BSONValue associated with the given key
,
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 key to be found in the document
When implementing a custom reader, getAsTry must be preferred.
Gets the BSONValue associated with the given key
,
and converts it with the given implicit BSONReader.
Gets the BSONValue associated with the given key
,
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
may hold a exceptions.BSONValueNotFoundException,
if the key could not be found.
the key to be found in the document
Gets the BSONValue at the given key
,
and converts it with the given implicit BSONReader.
Gets the BSONValue at the given key
,
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 key to be found in the document
The number of fields
The number of fields
Returns the map representation for this document.
Returns the map representation for this document.
Returns the values of the document fields.
A
BSONDocument
structure (BSON type0x03
).A
BSONDocument
is basically a set of fields(String, BSONValue)
.Note: The insertion/initial order of the fields may not be maintained through the operations.