case class Document(underlying: BsonDocument) extends BaseDocument[Document] with IterableOps[(String, BsonValue), Iterable, Document] with StrictOptimizedIterableOps[(String, BsonValue), Iterable, Document] with Product with Serializable
An mutable Document implementation.
A strictly typed Map[String, BsonValue]
like structure that traverses the elements in insertion order. Unlike native scala maps there
is no variance in the value type and it always has to be a BsonValue
.
- underlying
the underlying BsonDocument which stores the data.
- Alphabetic
- By Inheritance
- Document
- Serializable
- Product
- Equals
- StrictOptimizedIterableOps
- BaseDocument
- Bson
- Iterable
- IterableFactoryDefaults
- IterableOps
- IterableOnceOps
- IterableOnce
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Document(underlying: BsonDocument)
- underlying
the underlying BsonDocument which stores the data.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def +(elems: CanBeBsonElement*): Document
Creates a new document containing a new key/value and all the existing key/values.
Creates a new document containing a new key/value and all the existing key/values.
Mapping
kv
will override existing mappings from this document with the same key.- elems
the key/value mapping to be added. This can be any valid
(String, BsonValue)
pair that can be transformed into a BsonElement via BsonMagnets.CanBeBsonElement implicits and any BsonTransformers that are in scope.- returns
a new document containing mappings of this document and the mapping
kv
.
- Definition Classes
- BaseDocument
- final def ++(suffix: IterableOnce[(String, BsonValue)]): Document
- Annotations
- @inline()
- final def ++[B >: (String, BsonValue)](suffix: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- Annotations
- @inline()
- def ++=(elems: CanBeBsonElements): Document
Adds all elements produced by a TraversableOnce to this document.
Adds all elements produced by a TraversableOnce to this document.
- elems
a sequence of key/values that make up the Document. This can be any valid sequence of
(String, BsonValue)
pairs that can be transformed into a sequence of BsonElements via BsonMagnets.CanBeBsonElements implicits and any BsonTransformers that are in scope.- returns
the document itself.
- def +=(elems: CanBeBsonElement*): Document
Adds a new key/value pair to this document.
Adds a new key/value pair to this document. If the document already contains a mapping for the key, it will be overridden by the new value.
- elems
the key/value pair. This can be any valid
(String, BsonValue)
pair that can be transformed into a BsonElement via BsonMagnets.CanBeBsonElement implicits and any BsonTransformers that are in scope.- returns
the document itself
- def -(elems: String*): Document
Removes one or more elements to this document and returns a new document.
Removes one or more elements to this document and returns a new document.
- elems
the remaining elements to remove.
- returns
A new document with the keys removed.
- Definition Classes
- BaseDocument
- def --(xs: GenTraversableOnce[String]): Document
Removes a number of elements provided by a traversable object and returns a new document without the removed elements.
Removes a number of elements provided by a traversable object and returns a new document without the removed elements.
- xs
the traversable object consisting of key-value pairs.
- returns
a new document with the bindings of this document and those from
xs
.
- Definition Classes
- BaseDocument
- def --=(xs: IterableOnce[String]): Document
Removes all elements produced by an iterator from this document.
Removes all elements produced by an iterator from this document.
- xs
the iterator producing the elements to remove.
- returns
the document itself
- def -=(elems: String*): Document
Removes two or more elements from this document.
Removes two or more elements from this document.
- elems
the remaining elements to remove.
- returns
the document itself
- def -=(key: String): Document
Removes a key from this document.
Removes a key from this document.
- key
the key to be removed
- returns
the document itself.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def addString(b: StringBuilder): StringBuilder
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def addString(b: StringBuilder, sep: String): StringBuilder
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
- Definition Classes
- IterableOnceOps
- def apply(underlying: BsonDocument): Document
Creates a new immutable document
- def apply[TResult <: BsonValue](key: String)(implicit e: DefaultsTo[TResult, BsonValue], ct: ClassTag[TResult]): TResult
Retrieves the value which is associated with the given key or throws a
NoSuchElementException
.Retrieves the value which is associated with the given key or throws a
NoSuchElementException
.- key
the key
- returns
the value associated with the given key, or throws
NoSuchElementException
.
- Definition Classes
- BaseDocument
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def className: String
- Attributes
- protected[this]
- Definition Classes
- Iterable
- def clear(): Unit
Removes all bindings from the document.
Removes all bindings from the document. After this operation has completed the document will be empty.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def coll: Document.this.type
- Attributes
- protected
- Definition Classes
- Iterable → IterableOps
- def collect[B](pf: PartialFunction[(String, BsonValue), B]): Iterable[B]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def collectFirst[B](pf: PartialFunction[(String, BsonValue), B]): Option[B]
- Definition Classes
- IterableOnceOps
- def concat(suffix: IterableOnce[(String, BsonValue)]): Document
- def concat[B >: (String, BsonValue)](suffix: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- def contains(key: String): Boolean
Tests whether this map contains a binding for a key
Tests whether this map contains a binding for a key
- key
the key
- returns
true if there is a binding for key in this document, false otherwise.
- Definition Classes
- BaseDocument
- def copy(): Document
Copies the document and creates a new one
Copies the document and creates a new one
- returns
a new document with a copy of the underlying BsonDocument
- def copyToArray[B >: (String, BsonValue)](xs: Array[B], start: Int, len: Int): Int
- Definition Classes
- IterableOnceOps
- def copyToArray[B >: (String, BsonValue)](xs: Array[B], start: Int): Int
- Definition Classes
- IterableOnceOps
- def copyToArray[B >: (String, BsonValue)](xs: Array[B]): Int
- Definition Classes
- IterableOnceOps
- def corresponds[B](that: IterableOnce[B])(p: ((String, BsonValue), B) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def count(p: ((String, BsonValue)) => Boolean): Int
- Definition Classes
- IterableOnceOps
- def drop(n: Int): Document
- Definition Classes
- IterableOps → IterableOnceOps
- def dropRight(n: Int): Document
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def dropWhile(p: ((String, BsonValue)) => Boolean): Document
- Definition Classes
- IterableOps → IterableOnceOps
- def empty: Document
- Definition Classes
- Document → IterableFactoryDefaults → IterableOps
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def exists(p: ((String, BsonValue)) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def filter(pred: ((String, BsonValue)) => Boolean): Document
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def filterImpl(pred: ((String, BsonValue)) => Boolean, isFlipped: Boolean): Document
- Attributes
- protected[scala.collection]
- Definition Classes
- StrictOptimizedIterableOps
- def filterKeys(p: (String) => Boolean): Document
Filters this document by retaining only keys satisfying a predicate.
Filters this document by retaining only keys satisfying a predicate.
- p
the predicate used to test keys
- returns
a new document consisting only of those key value pairs of this map where the key satisfies the predicate
p
.
- Definition Classes
- BaseDocument
- def filterNot(pred: ((String, BsonValue)) => Boolean): Document
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def find(p: ((String, BsonValue)) => Boolean): Option[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def flatMap[B](f: ((String, BsonValue)) => IterableOnce[B]): Iterable[B]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def flatten[B](implicit toIterableOnce: ((String, BsonValue)) => IterableOnce[B]): Iterable[B]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def fold[A1 >: (String, BsonValue)](z: A1)(op: (A1, A1) => A1): A1
- Definition Classes
- IterableOnceOps
- def foldLeft[B](z: B)(op: (B, (String, BsonValue)) => B): B
- Definition Classes
- IterableOnceOps
- def foldRight[B](z: B)(op: ((String, BsonValue), B) => B): B
- Definition Classes
- IterableOnceOps
- def forall(p: ((String, BsonValue)) => Boolean): Boolean
- Definition Classes
- IterableOnceOps
- def foreach[U](f: ((String, BsonValue)) => U): Unit
Applies a function
f
to all elements of this document.Applies a function
f
to all elements of this document.- U
the type parameter describing the result of function
f
. This result will always be ignored. TypicallyU
isUnit
, but this is not necessary.- f
the function that is applied for its side-effect to every element. The result of function
f
is discarded.
- Definition Classes
- Document → IterableOnceOps
- def fromSpecific(coll: IterableOnce[(String, BsonValue)]): Document
- Attributes
- protected
- Definition Classes
- Document → IterableFactoryDefaults → IterableOps
- def get[TResult <: BsonValue](key: String)(implicit e: DefaultsTo[TResult, BsonValue], ct: ClassTag[TResult]): Option[TResult]
Optionally returns the value associated with a key.
Optionally returns the value associated with a key.
- key
the key we want to lookup
- returns
an option value containing the value associated with
key
in this document, orNone
if none exists.
- Definition Classes
- BaseDocument
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getOrElse[B >: BsonValue](key: String, default: CanBeBsonValue): B
Returns the value associated with a key, or a default value if the key is not contained in the map.
Returns the value associated with a key, or a default value if the key is not contained in the map.
- B
the result type of the default computation.
- key
the key.
- default
The default value in case no binding for
key
is found in the Document. This can be any BsonValue type or any native type that has an implicit BsonTransformer in scope.- returns
the value associated with
key
if it exists, otherwise the result of thedefault
computation.
- Definition Classes
- BaseDocument
- def getOrElseUpdate[B](key: String, op: => B)(implicit transformer: BsonTransformer[B]): BsonValue
If given key is already in this document, returns associated value.
If given key is already in this document, returns associated value.
Otherwise, computes value from given expression
op
, stores with key in document and returns that value.- key
the key to test
- op
the computation yielding the value to associate with
key
, ifkey
is previously unbound.- returns
the value associated with key (either previously or as a result of executing the method).
- def groupBy[K](f: ((String, BsonValue)) => K): Map[K, Document]
- Definition Classes
- IterableOps
- def groupMap[K, B](key: ((String, BsonValue)) => K)(f: ((String, BsonValue)) => B): Map[K, Iterable[B]]
- Definition Classes
- IterableOps
- def groupMapReduce[K, B](key: ((String, BsonValue)) => K)(f: ((String, BsonValue)) => B)(reduce: (B, B) => B): Map[K, B]
- Definition Classes
- IterableOps
- def grouped(size: Int): Iterator[Document]
- Definition Classes
- IterableOps
- def head: (String, BsonValue)
- Definition Classes
- IterableOps
- def headOption: Option[(String, BsonValue)]
- Definition Classes
- IterableOps
- def init: Document
- Definition Classes
- IterableOps
- def inits: Iterator[Document]
- Definition Classes
- IterableOps
- def isEmpty: Boolean
- Definition Classes
- IterableOnceOps
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isTraversableAgain: Boolean
- Definition Classes
- IterableOps → IterableOnceOps
- def iterableFactory: IterableFactory[Iterable]
- Definition Classes
- Iterable → IterableOps
- def iterator: Iterator[(String, BsonValue)]
Creates a new iterator over all key/value pairs in this document
Creates a new iterator over all key/value pairs in this document
- returns
the new iterator
- Definition Classes
- BaseDocument → IterableOnce
- def keySet: Set[String]
Collects all keys of this document in a set.
Collects all keys of this document in a set.
- returns
a set containing all keys of this document.
- Definition Classes
- BaseDocument
- def keys: Iterable[String]
Collects all keys of this document in an iterable collection.
Collects all keys of this document in an iterable collection.
- returns
the keys of this document as an iterable.
- Definition Classes
- BaseDocument
- def keysIterator: Iterator[String]
Creates an iterator for all keys.
Creates an iterator for all keys.
- returns
an iterator over all keys.
- Definition Classes
- BaseDocument
- def knownSize: Int
- Definition Classes
- IterableOnce
- def last: (String, BsonValue)
- Definition Classes
- IterableOps
- def lastOption: Option[(String, BsonValue)]
- Definition Classes
- IterableOps
- def lazyZip[B](that: Iterable[B]): LazyZip2[(String, BsonValue), B, Document.this.type]
- Definition Classes
- Iterable
- def map[B](f: ((String, BsonValue)) => (String, BsonValue)): Document
- def map[B](f: ((String, BsonValue)) => B): Iterable[B]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def max[B >: (String, BsonValue)](implicit ord: Ordering[B]): (String, BsonValue)
- Definition Classes
- IterableOnceOps
- def maxBy[B](f: ((String, BsonValue)) => B)(implicit cmp: Ordering[B]): (String, BsonValue)
- Definition Classes
- IterableOnceOps
- def maxByOption[B](f: ((String, BsonValue)) => B)(implicit cmp: Ordering[B]): Option[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def maxOption[B >: (String, BsonValue)](implicit ord: Ordering[B]): Option[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def min[B >: (String, BsonValue)](implicit ord: Ordering[B]): (String, BsonValue)
- Definition Classes
- IterableOnceOps
- def minBy[B](f: ((String, BsonValue)) => B)(implicit cmp: Ordering[B]): (String, BsonValue)
- Definition Classes
- IterableOnceOps
- def minByOption[B](f: ((String, BsonValue)) => B)(implicit cmp: Ordering[B]): Option[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def minOption[B >: (String, BsonValue)](implicit ord: Ordering[B]): Option[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- final def mkString: String
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def mkString(sep: String): String
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- final def mkString(start: String, sep: String, end: String): String
- Definition Classes
- IterableOnceOps
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newSpecificBuilder: Builder[(String, BsonValue), Document]
- Attributes
- protected
- Definition Classes
- Document → IterableFactoryDefaults → IterableOps
- def nonEmpty: Boolean
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecatedOverriding("nonEmpty is defined as !isEmpty; override isEmpty instead", "2.13.0")
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def partition(p: ((String, BsonValue)) => Boolean): (Document, Document)
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def partitionMap[A1, A2](f: ((String, BsonValue)) => Either[A1, A2]): (Iterable[A1], Iterable[A2])
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def product[B >: (String, BsonValue)](implicit num: Numeric[B]): B
- Definition Classes
- IterableOnceOps
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def put[B](key: String, value: B)(implicit transformer: BsonTransformer[B]): Option[BsonValue]
Adds a new key/value pair to this document and optionally returns previously bound value.
Adds a new key/value pair to this document and optionally returns previously bound value. If the document already contains a mapping for the key, it will be overridden by the new value.
- key
the key to update
- value
the new value
- returns
an option value containing the value associated with the key before the
put
operation was executed, orNone
ifkey
was not defined in the document before.
- def reduce[B >: (String, BsonValue)](op: (B, B) => B): B
- Definition Classes
- IterableOnceOps
- def reduceLeft[B >: (String, BsonValue)](op: (B, (String, BsonValue)) => B): B
- Definition Classes
- IterableOnceOps
- def reduceLeftOption[B >: (String, BsonValue)](op: (B, (String, BsonValue)) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def reduceOption[B >: (String, BsonValue)](op: (B, B) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def reduceRight[B >: (String, BsonValue)](op: ((String, BsonValue), B) => B): B
- Definition Classes
- IterableOnceOps
- def reduceRightOption[B >: (String, BsonValue)](op: ((String, BsonValue), B) => B): Option[B]
- Definition Classes
- IterableOnceOps
- def remove(key: String): Option[BsonValue]
Removes a key from this document, returning the value associated previously with that key as an option.
Removes a key from this document, returning the value associated previously with that key as an option.
- key
the key to be removed
- returns
an option value containing the value associated previously with
key
, orNone
ifkey
was not defined in the document before.
- def retain(p: (String, BsonValue) => Boolean): Document
Retains only those mappings for which the predicate
p
returnstrue
.Retains only those mappings for which the predicate
p
returnstrue
.- p
The test predicate
- def reversed: Iterable[(String, BsonValue)]
- Attributes
- protected
- Definition Classes
- IterableOnceOps
- def scan[B >: (String, BsonValue)](z: B)(op: (B, B) => B): Iterable[B]
- Definition Classes
- IterableOps
- def scanLeft[B](z: B)(op: (B, (String, BsonValue)) => B): Iterable[B]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def scanRight[B](z: B)(op: ((String, BsonValue), B) => B): Iterable[B]
- Definition Classes
- IterableOps
- def size: Int
- Definition Classes
- IterableOnceOps
- def sizeCompare(that: Iterable[_]): Int
- Definition Classes
- IterableOps
- def sizeCompare(otherSize: Int): Int
- Definition Classes
- IterableOps
- final def sizeIs: SizeCompareOps
- Definition Classes
- IterableOps
- Annotations
- @inline()
- def slice(from: Int, until: Int): Document
- Definition Classes
- IterableOps → IterableOnceOps
- def sliding(size: Int, step: Int): Iterator[Document]
- Definition Classes
- IterableOps
- def sliding(size: Int): Iterator[Document]
- Definition Classes
- IterableOps
- def span(p: ((String, BsonValue)) => Boolean): (Document, Document)
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def splitAt(n: Int): (Document, Document)
- Definition Classes
- IterableOps → IterableOnceOps
- def stepper[S <: Stepper[_]](implicit shape: StepperShape[(String, BsonValue), S]): S
- Definition Classes
- IterableOnce
- final def strictOptimizedCollect[B, C2](b: Builder[B, C2], pf: PartialFunction[(String, BsonValue), B]): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- final def strictOptimizedConcat[B >: (String, BsonValue), C2](that: IterableOnce[B], b: Builder[B, C2]): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- final def strictOptimizedFlatMap[B, C2](b: Builder[B, C2], f: ((String, BsonValue)) => IterableOnce[B]): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- final def strictOptimizedFlatten[B, C2](b: Builder[B, C2])(implicit toIterableOnce: ((String, BsonValue)) => IterableOnce[B]): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- final def strictOptimizedMap[B, C2](b: Builder[B, C2], f: ((String, BsonValue)) => B): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- final def strictOptimizedZip[B, C2](that: IterableOnce[B], b: Builder[((String, BsonValue), B), C2]): C2
- Attributes
- protected[this]
- Definition Classes
- StrictOptimizedIterableOps
- Annotations
- @inline()
- def stringPrefix: String
- Attributes
- protected[this]
- Definition Classes
- Iterable
- Annotations
- @deprecatedOverriding("Override className instead", "2.13.0")
- def sum[B >: (String, BsonValue)](implicit num: Numeric[B]): B
- Definition Classes
- IterableOnceOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tail: Document
- Definition Classes
- IterableOps
- def tails: Iterator[Document]
- Definition Classes
- IterableOps
- def take(n: Int): Document
- Definition Classes
- IterableOps → IterableOnceOps
- def takeRight(n: Int): Document
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def takeWhile(p: ((String, BsonValue)) => Boolean): Document
- Definition Classes
- IterableOps → IterableOnceOps
- def tapEach[U](f: ((String, BsonValue)) => U): Document
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
- def to[C1](factory: Factory[(String, BsonValue), C1]): C1
- Definition Classes
- IterableOnceOps
- def toArray[B >: (String, BsonValue)](implicit arg0: ClassTag[B]): Array[B]
- Definition Classes
- IterableOnceOps
- def toBsonDocument[TDocument](documentClass: Class[TDocument], codecRegistry: CodecRegistry): BsonDocument
- Definition Classes
- BaseDocument → Bson
- def toBsonDocument: BsonDocument
Returns a copy of the underlying BsonDocument
Returns a copy of the underlying BsonDocument
- Definition Classes
- BaseDocument
- final def toBuffer[B >: (String, BsonValue)]: Buffer[B]
- Definition Classes
- IterableOnceOps
- Annotations
- @inline()
- def toIndexedSeq: IndexedSeq[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- final def toIterable: Document.this.type
- Definition Classes
- Iterable → IterableOps
- def toJson(settings: JsonWriterSettings): String
Gets a JSON representation of this document using the given
JsonWriterSettings
.Gets a JSON representation of this document using the given
JsonWriterSettings
.- settings
the JSON writer settings
- returns
a JSON representation of this document
- Definition Classes
- BaseDocument
- def toJson(): String
Gets a JSON representation of this document
Gets a JSON representation of this document
- returns
a JSON representation of this document
- Definition Classes
- BaseDocument
- def toList: List[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def toMap[K, V](implicit ev: <:<[(String, BsonValue), (K, V)]): Map[K, V]
- Definition Classes
- IterableOnceOps
- def toSeq: Seq[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def toSet[B >: (String, BsonValue)]: Set[B]
- Definition Classes
- IterableOnceOps
- def toString(): String
- Definition Classes
- Iterable → AnyRef → Any
- def toVector: Vector[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- def transform[B](f: (String, BsonValue) => B)(implicit transformer: BsonTransformer[B]): Document
Applies a transformation function to all values contained in this document.
Applies a transformation function to all values contained in this document. The transformation function produces new values from existing keys associated values.
- f
the transformation to apply
- returns
the document itself.
- def transpose[B](implicit asIterable: ((String, BsonValue)) => Iterable[B]): Iterable[Iterable[B]]
- Definition Classes
- IterableOps
- val underlying: BsonDocument
The underlying bson document
- def unzip[A1, A2](implicit asPair: ((String, BsonValue)) => (A1, A2)): (Iterable[A1], Iterable[A2])
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def unzip3[A1, A2, A3](implicit asTriple: ((String, BsonValue)) => (A1, A2, A3)): (Iterable[A1], Iterable[A2], Iterable[A3])
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def update[B](key: String, value: B)(implicit transformer: BsonTransformer[B]): Unit
Adds a new key/value pair to this map.
Adds a new key/value pair to this map. If the document already contains a mapping for the key, it will be overridden by the new value.
- key
The key to update
- value
The new value
- def updated(elems: CanBeBsonElement*): Document
Creates a new Document consisting of all key/value pairs of the current document plus a new pair of a given key and value.
Creates a new Document consisting of all key/value pairs of the current document plus a new pair of a given key and value.
- elems
The key/values to add. This can be any valid
(String, BsonValue)
pair that can be transformed into a BsonElement via BsonMagnets.CanBeBsonElement implicits and any BsonTransformers that are in scope.- returns
A fresh immutable document with the binding from
key
tovalue
added to the new document.
- Definition Classes
- BaseDocument
- def updated[B](key: String, value: B)(implicit transformer: BsonTransformer[B]): Document
Creates a new Document consisting of all key/value pairs of the current document plus a new pair of a given key and value.
Creates a new Document consisting of all key/value pairs of the current document plus a new pair of a given key and value.
- key
The key to add
- value
The new value
- returns
A fresh immutable document with the binding from
key
tovalue
added to the new document.
- Definition Classes
- BaseDocument
- def values: Iterable[BsonValue]
Collects all values of this document in an iterable collection.
Collects all values of this document in an iterable collection.
- returns
the values of this document as an iterable.
- Definition Classes
- BaseDocument
- def valuesIterator: Iterator[BsonValue]
Creates an iterator for all values in this document.
Creates an iterator for all values in this document.
- returns
an iterator over all values that are associated with some key in this document.
- Definition Classes
- BaseDocument
- def view: View[(String, BsonValue)]
- Definition Classes
- IterableOps
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def withFilter(p: ((String, BsonValue)) => Boolean): WithFilter[(String, BsonValue), Iterable]
- Definition Classes
- IterableOps
- def zip[B](that: IterableOnce[B]): Iterable[((String, BsonValue), B)]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps
- def zipAll[A1 >: (String, BsonValue), B](that: Iterable[B], thisElem: A1, thatElem: B): Iterable[(A1, B)]
- Definition Classes
- IterableOps
- def zipWithIndex: Iterable[((String, BsonValue), Int)]
- Definition Classes
- StrictOptimizedIterableOps → IterableOps → IterableOnceOps
Deprecated Value Members
- def ++:[B >: (String, BsonValue)](that: IterableOnce[B]): Iterable[B]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use ++ instead of ++: for collections of type Iterable
- final def /:[B](z: B)(op: (B, (String, BsonValue)) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use foldLeft instead of /:
- final def :\[B](z: B)(op: ((String, BsonValue), B) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use foldRight instead of :\
- def aggregate[B](z: => B)(seqop: (B, (String, BsonValue)) => B, combop: (B, B) => B): B
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0)
aggregate
is not relevant for sequential collections. UsefoldLeft(z)(seqop)
instead.
- def companion: IterableFactory[Iterable]
- Definition Classes
- IterableOps
- Annotations
- @deprecated @deprecatedOverriding("Use iterableFactory instead", "2.13.0") @inline()
- Deprecated
(Since version 2.13.0) Use iterableFactory instead
- final def copyToBuffer[B >: (String, BsonValue)](dest: Buffer[B]): Unit
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use
dest ++= coll
instead
- 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 hasDefiniteSize: Boolean
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
- final def repr: Document
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use coll instead of repr in a collection implementation, use the collection value itself from the outside
- def seq: Document.this.type
- Definition Classes
- Iterable
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Iterable.seq always returns the iterable itself
- final def toIterator: Iterator[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use .iterator instead of .toIterator
- final def toStream: Stream[(String, BsonValue)]
- Definition Classes
- IterableOnceOps
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.13.0) Use .to(LazyList) instead of .toStream
- final def toTraversable: Traversable[(String, BsonValue)]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use toIterable instead
- def view(from: Int, until: Int): View[(String, BsonValue)]
- Definition Classes
- IterableOps
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use .view.slice(from, until) instead of .view(from, until)
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: