Object/Class

reactivemongo.api.bson

BSONDocument

Related Docs: class BSONDocument | package bson

Permalink

object BSONDocument

BSONDocument factories & utilities.

reactivemongo.api.bson.BSONDocument("foo" -> 1, "bar" -> "lorem")
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BSONDocument
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type Strict = BSONDocument with BSONStrictDocument

    Permalink

    EXPERIMENTAL

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(elms: Iterable[(String, BSONValue)]): BSONDocument

    Permalink

    Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).

    Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).

    import reactivemongo.api.bson._
    
    BSONDocument(Seq(
      "foo" -> BSONInteger(1), "bar" -> BSONString("lorem")))
    // { 'foo': 1, 'bar': 'lorem' }
  5. def apply(elms: ElementProducer*): BSONDocument

    Permalink

    Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).

    Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).

    reactivemongo.api.bson.BSONDocument(
      "foo" -> 1, "bar" -> "lorem"
    ) // => { 'foo': 1, 'bar': 'lorem' }
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val empty: BSONDocument

    Permalink

    An empty BSONDocument.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def newBuilder: Builder[ElementProducer, BSONDocument]

    Permalink

    EXPERIMENTAL: Returns a BSONDocument builder.

    EXPERIMENTAL: Returns a BSONDocument builder.

    import reactivemongo.api.bson.{ BSONDocument, ElementProducer }
    
    val builder = BSONDocument.newBuilder
    
    builder += ("foo" -> 1)
    builder ++= Seq("bar" -> "lorem", "ipsum" -> 3.45D)
    builder ++= Some[ElementProducer]("dolor" -> 6L)
    
    // builder.result() == {'foo':1, 'bar':'lorem', 'ipsum':3.45, 'dolor':6}
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def pretty(doc: BSONDocument): String

    Permalink

    Returns a String representing the given BSONDocument.

    Returns a String representing the given BSONDocument.

    import reactivemongo.api.bson.BSONDocument
    
    def printDoc(doc: BSONDocument): String = BSONDocument.pretty(doc)
    See also

    BSONValue$.pretty

  20. def strict(elms: Iterable[(String, BSONValue)]): Strict

    Permalink

    EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name).

    EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name). Then append operations on such document will maintain element unicity by field name (see BSONStrictDocument.++).

    import reactivemongo.api.bson._
    
    BSONDocument.strict(Seq(
      "foo" -> BSONInteger(1), "foo" -> BSONString("lorem")))
    // { 'foo': 1 }
  21. def strict(elms: ElementProducer*): Strict

    Permalink

    EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name).

    EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name). Then append operations on such document will maintain element unicity by field name (see BSONStrictDocument.++).

    reactivemongo.api.bson.BSONDocument("foo" -> 1, "bar" -> 2, "foo" -> 3)
    // => { "foo": 1, "bar": 2 } : No "foo": 3
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. def unapply(that: Any): Option[Seq[BSONElement]]

    Permalink

    Extracts the elements if that's a BSONDocument.

    Extracts the elements if that's a BSONDocument.

    import reactivemongo.api.bson.{ BSONDocument, BSONValue }
    
    def names(v: BSONValue): Seq[String] = v match {
      case BSONDocument(elements) => elements.map(_.name)
      case _ => Seq.empty[String]
    }
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped