org.mongodb.scala.bson.collection.immutable
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
.
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
.
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
.
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.
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.
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.
(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
(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.
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 immutable 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.