the underlying BsonDocument which stores the data.
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.
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.
a new document containing mappings of this document and the mapping kv
.
Adds all elements produced by a TraversableOnce to this document.
Adds all elements produced by a TraversableOnce to this document.
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.
the document itself.
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.
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.
the document itself
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.
the remaining elements to remove.
A new document with the keys removed.
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.
the traversable object consisting of key-value pairs.
a new document with the bindings of this document and those from xs
.
Removes all elements produced by an iterator from this document.
Removes all elements produced by an iterator from this document.
the iterator producing the elements to remove.
the document itself
Removes two or more elements from this document.
Removes two or more elements from this document.
the remaining elements to remove.
the document itself
Removes a key from this document.
Removes a key from this document.
the key to be removed
the document itself.
Creates a new immutable document
Creates a new immutable document
the underlying BsonDocument
a new document
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
.
the key
the value associated with the given key, or throws NoSuchElementException
.
Removes all bindings from the document.
Removes all bindings from the document. After this operation has completed the document will be empty.
Tests whether this map contains a binding for a key
Tests whether this map contains a binding for a key
the key
true if there is a binding for key in this document, false otherwise.
Copies the document and creates a new one
Copies the document and creates a new one
a new document with a copy of the underlying BsonDocument
Filters this document by retaining only keys satisfying a predicate.
Filters this document by retaining only keys satisfying a predicate.
the predicate used to test keys
a new document consisting only of those key value pairs of this map where the key satisfies
the predicate p
.
Applies a function f
to all elements of this document.
Applies a function f
to all elements of this document.
the type parameter describing the result of function f
.
This result will always be ignored. Typically U
is Unit
,
but this is not necessary.
the function that is applied for its side-effect to every element.
The result of function f
is discarded.
Optionally returns the value associated with a key.
Optionally returns the value associated with a key.
the key we want to lookup
an option value containing the value associated with key
in this document,
or None
if none exists.
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.
the result type of the default computation.
the key.
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.
the value associated with key
if it exists,
otherwise the result of the default
computation.
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.
the key to test
the computation yielding the value to associate with key
, if key
is previously unbound.
the value associated with key (either previously or as a result of executing the method).
Creates a new iterator over all key/value pairs in this document
Creates a new iterator over all key/value pairs in this document
the new iterator
Collects all keys of this document in a set.
Collects all keys of this document in a set.
a set containing all keys of this document.
Collects all keys of this document in an iterable collection.
Collects all keys of this document in an iterable collection.
the keys of this document as an iterable.
Creates an iterator for all keys.
Creates an iterator for all keys.
an iterator over all keys.
Creates a new builder for this collection type.
Creates a new builder for this collection type.
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.
the key to update
the new value
an option value containing the value associated with the key before the put
operation was executed, or
None
if key
was not defined in the document before.
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.
the key to be removed
an option value containing the value associated previously with key
,
or None
if key
was not defined in the document before.
Retains only those mappings for which the predicate p
returns true
.
Retains only those mappings for which the predicate p
returns true
.
The test predicate
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
Returns a copy of the underlying BsonDocument
Returns a copy of the underlying BsonDocument
Gets a JSON representation of this document using the given JsonWriterSettings
.
Gets a JSON representation of this document using the given JsonWriterSettings
.
the JSON writer settings
a JSON representation of this document
Gets a JSON representation of this document
Gets a JSON representation of this document
a JSON representation of this 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.
the transformation to apply
the document itself.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
the underlying BsonDocument which stores the data.
the underlying BsonDocument which stores the data.
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.
The key to update
The new 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.
Creates a new Document consisting of all key/value pairs of the current document plus a new pair of a given key and value.
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.
A fresh immutable document with the binding from key
to value
added to the new 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.
The key to add
The new value
A fresh immutable document with the binding from key
to value
added to the new document.
Collects all values of this document in an iterable collection.
Collects all values of this document in an iterable collection.
the values of this document as an iterable.
Creates an iterator for all values in this document.
Creates an iterator for all values in this document.
an iterator over all values that are associated with some key in this document.
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 aBsonValue
.the underlying BsonDocument which stores the data.