Packages

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.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BSONDocument
  2. Serializable
  3. Product
  4. Equals
  5. BSONElementSet
  6. ElementProducer
  7. Producer
  8. BSONValue
  9. AnyRef
  10. Any
Implicitly
  1. by identityValueProducer
  2. by valueProducer
  3. by ExtendedBSONValue
  4. by any2stringadd
  5. by StringFormat
  6. by Ensuring
  7. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new BSONDocument(stream: Stream[Try[BSONElement]])

Type Members

  1. type SetType = BSONDocument
    Definition Classes
    BSONDocumentBSONElementSet

Value Members

  1. def ++(elements: Producer[BSONElement]*): BSONDocument

    Alias for :~ or merge

  2. def ++(doc: BSONDocument): BSONDocument

    Alias for add(doc: BSONDocument): BSONDocument

  3. def --(keys: String*): BSONDocument

    Alias for remove(names: String*)

  4. def :~(elements: Producer[BSONElement]*): BSONDocument

    Merge the produced elements with this set

    Merge the produced elements with this set

    Definition Classes
    BSONDocumentBSONElementSet
  5. 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
  6. 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
  7. 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
  8. 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
  9. val code: Byte

    The code indicating the BSON type for this value

    The code indicating the BSON type for this value

    Definition Classes
    BSONDocumentBSONValue
  10. 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
    BSONDocumentBSONElementSet
  11. lazy val elements: Stream[BSONElement]

    Returns a Stream for all the elements of this BSONDocument.

    Returns a Stream for all the elements of this BSONDocument.

    Definition Classes
    BSONDocumentBSONElementSet
  12. 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, returns None.

    key

    the key to be found in the document

    Definition Classes
    BSONDocumentBSONElementSet
  13. 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.

  14. 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. The Failure holds a exceptions.DocumentKeyNotFound if the key could not be found.

    key

    the key to be found in the document

  15. 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 holding None. If the value could not be deserialized or converted, returns a Failure.

  16. 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. The Failure holds a exceptions.DocumentKeyNotFound if the key could not be found.

    key

    the key to be found in the document

  17. 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 a Failure.

    key

    the key to be found in the document

  18. def headOption: Option[BSONElement]

    The first/mandatory nested element, if any

    The first/mandatory nested element, if any

    Definition Classes
    BSONDocumentBSONElementSet
  19. def isEmpty: Boolean

    Indicates whether this element set is empty

    Indicates whether this element set is empty

    Definition Classes
    BSONDocumentBSONElementSet
    Annotations
    @inline()
  20. def merge(elements: Producer[BSONElement]*): BSONDocument

    Creates a new BSONDocument containing all the elements of this one and the given elements.

  21. def merge(doc: BSONDocument): BSONDocument

    Creates a new BSONDocument containing all the elements of this one and the elements of the given document.

  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. def remove(keys: String*): BSONDocument

    Creates a new BSONDocument without the elements corresponding the given keys.

  24. 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
  25. 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
  26. def size: Int

    The number of elements

    The number of elements

    Definition Classes
    BSONDocumentBSONElementSet
    Annotations
    @inline()
  27. val stream: Stream[Try[BSONElement]]
  28. def toMap: Map[String, BSONValue]

    Returns a Map representation for this element set.

    Returns a Map representation for this element set.

    Definition Classes
    BSONElementSet
  29. def toString(): String
    Definition Classes
    BSONDocument → AnyRef → Any
  30. def values: Stream[BSONValue]

    Returns the values for the nested elements.

    Returns the values for the nested elements.

    Definition Classes
    BSONDocumentBSONElementSet
  31. 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
    BSONDocumentBSONElementSet