BsonDocument
A BSON document.
To create instances of this class, see BsonFactory.
Navigating BSON types
This interface is part of the BSON trinity:
BsonDocument represents an entire BSON document.
BsonArray represents an array of BSON values.
BsonValue represents a single value in isolation.
Usage
val bson: BsonDocument = …
for ((name, field) in bson) {
println("Field: $name • ${field.type}")
}The iteration order of a BSON document is preserved: fields appear in the same order as they are written in.
Equality
Different implementations of this interface are considered equal if they represent the same value with the same type. That is, both values would result in the exact same BSON sent over the wire.
The methods BsonDocument.Companion.equals and BsonDocument.Companion.hashCode are provided as default implementations.
Types
Properties
Functions
Creates an Iterable that wraps this document.
Creates a Sequence of the fields in this document.
Finds the first value that matches path in a given BSON document.
Analyzes the difference between two BSON documents.
Returns true if this document has at least one field.
Iterates over the fields in this document.
Finds all values that match path in a given BSON document.
Finds the first value that matches path in a given BSON document.
Generates a ByteArray of the raw BSON representation of this value.
JSON representation of this BsonDocument object, as a String.