case class BSONDocument(stream: Stream[Try[BSONElement]]) extends BSONValue with BSONElementSet with Product with Serializable
A BSONDocument
structure (BSON type 0x03
).
A BSONDocument
is basically a stream of tuples (String, BSONValue)
.
It is completely lazy. The stream it wraps is a Stream[Try[(String, BSONValue)]]
since
we cannot be sure that a not yet deserialized value will be processed without error.
- Alphabetic
- By Inheritance
- BSONDocument
- Serializable
- Product
- Equals
- BSONElementSet
- ElementProducer
- Producer
- BSONValue
- AnyRef
- Any
- by identityValueProducer
- by valueProducer
- by ExtendedBSONValue
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new BSONDocument(stream: Stream[Try[BSONElement]])
Type Members
- type SetType = BSONDocument
- Definition Classes
- BSONDocument → BSONElementSet
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from BSONDocument toany2stringadd[BSONDocument] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ++(elements: Producer[BSONElement]*): BSONDocument
Alias for
:~
ormerge
- def ++(doc: BSONDocument): BSONDocument
Alias for
add(doc: BSONDocument): BSONDocument
- def --(keys: String*): BSONDocument
Alias for
remove(names: String*)
- def ->[B](y: B): (BSONDocument, B)
- Implicit
- This member is added by an implicit conversion from BSONDocument toArrowAssoc[BSONDocument] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- def :~(elements: Producer[BSONElement]*): BSONDocument
Merge the produced elements with this set
Merge the produced elements with this set
- Definition Classes
- BSONDocument → BSONElementSet
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def as[T](implicit reader: BSONReader[BSONDocument, T]): T
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asOpt[T](implicit reader: BSONReader[BSONDocument, T]): Option[T]
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- def asTry[T](implicit reader: BSONReader[BSONDocument, T]): Try[T]
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- val bson: BSONDocument
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- val code: Byte
The code indicating the BSON type for this value
The code indicating the BSON type for this value
- Definition Classes
- BSONDocument → BSONValue
- def contains(key: String): Boolean
Checks whether the given key is found in this element set.
Checks whether the given key is found in this element set.
- key
the key to be found in the document
- returns
true if the key is found
- Definition Classes
- BSONDocument → BSONElementSet
- lazy val elements: Stream[BSONElement]
Returns a
Stream
for all the elements of thisBSONDocument
.Returns a
Stream
for all the elements of thisBSONDocument
.- Definition Classes
- BSONDocument → BSONElementSet
- def ensuring(cond: (BSONDocument) => Boolean, msg: => Any): BSONDocument
- Implicit
- This member is added by an implicit conversion from BSONDocument toEnsuring[BSONDocument] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (BSONDocument) => Boolean): BSONDocument
- Implicit
- This member is added by an implicit conversion from BSONDocument toEnsuring[BSONDocument] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): BSONDocument
- Implicit
- This member is added by an implicit conversion from BSONDocument toEnsuring[BSONDocument] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): BSONDocument
- Implicit
- This member is added by an implicit conversion from BSONDocument toEnsuring[BSONDocument] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from BSONDocument toStringFormat[BSONDocument] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- def get(key: String): Option[BSONValue]
Returns the BSONValue associated with the given
key
.Returns the BSONValue associated with the given
key
. If the key cannot be found, returnsNone
.- key
the key to be found in the document
- Definition Classes
- BSONDocument → BSONElementSet
- def getAs[T](key: String)(implicit reader: BSONReader[_ <: BSONValue, T]): Option[T]
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
.- key
the key to be found in the document
- Note
When implementing a custom reader, getAsTry must be preferred.
- def getAsTry[T](key: String)(implicit reader: BSONReader[_ <: BSONValue, T]): Try[T]
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
Failure
. TheFailure
holds a exceptions.DocumentKeyNotFound if the key could not be found.- key
the key to be found in the document
- def getAsUnflattenedTry[T](key: String)(implicit reader: BSONReader[_ <: BSONValue, T]): Try[Option[T]]
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, returns a
Success
holdingNone
. If the value could not be deserialized or converted, returns aFailure
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getTry(key: String): Try[BSONValue]
Returns the BSONValue associated with the given
key
.Returns the BSONValue associated with the given
key
.If the key is not found or the matching value cannot be deserialized, returns a
Failure
. TheFailure
holds a exceptions.DocumentKeyNotFound if the key could not be found.- key
the key to be found in the document
- def getUnflattenedTry(key: String): Try[Option[BSONValue]]
Returns the BSONValue associated with the given
key
.Returns the BSONValue associated with the given
key
.If the key could not be found, the resulting option will be
None
. If the matching value could not be deserialized, returns aFailure
.- key
the key to be found in the document
- def headOption: Option[BSONElement]
The first/mandatory nested element, if any
The first/mandatory nested element, if any
- Definition Classes
- BSONDocument → BSONElementSet
- def isEmpty: Boolean
Indicates whether this element set is empty
Indicates whether this element set is empty
- Definition Classes
- BSONDocument → BSONElementSet
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def merge(elements: Producer[BSONElement]*): BSONDocument
Creates a new BSONDocument containing all the elements of this one and the given
elements
. - def merge(doc: BSONDocument): BSONDocument
Creates a new BSONDocument containing all the elements of this one and the elements of the given document.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def remove(keys: String*): BSONDocument
Creates a new BSONDocument without the elements corresponding the given
keys
. - def seeAsOpt[T](implicit reader: BSONReader[_ <: BSONValue, T]): Option[T]
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- def seeAsTry[T](implicit reader: BSONReader[_ <: BSONValue, T]): Try[T]
- Implicit
- This member is added by an implicit conversion from BSONDocument toExtendedBSONValue[BSONDocument] performed by method ExtendedBSONValue in reactivemongo.bson.BSONValue.
- Definition Classes
- ExtendedBSONValue
- def size: Int
The number of elements
The number of elements
- Definition Classes
- BSONDocument → BSONElementSet
- Annotations
- @inline()
- val stream: Stream[Try[BSONElement]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toMap: Map[String, BSONValue]
Returns a
Map
representation for this element set.Returns a
Map
representation for this element set.- Definition Classes
- BSONElementSet
- def toString(): String
- Definition Classes
- BSONDocument → AnyRef → Any
- def values: Stream[BSONValue]
Returns the values for the nested elements.
Returns the values for the nested elements.
- Definition Classes
- BSONDocument → BSONElementSet
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def ~:(elements: Producer[BSONElement]): BSONDocument
Merge the produced elements at the beginning of this set
Merge the produced elements at the beginning of this set
- Definition Classes
- BSONDocument → BSONElementSet
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.
- def →[B](y: B): (BSONDocument, B)
- Implicit
- This member is added by an implicit conversion from BSONDocument toArrowAssoc[BSONDocument] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.