Bson Document
A type-safe container for a BSON document.
Parameters
the initial values
Constructors
Construct an empty document with the specified initial capacity.
Construct a new instance with a single key value pair
Construct a new instance with the given list BsonElements
Construct a new instance with the varargs of key value pairs
constructs the bson document with the initial values, defaults to an empty document
Types
Functions
Put the given key and value into this document, and return the document.
Gets this value as a BsonBinary if it is one, otherwise throws exception
Gets this value as a BsonBoolean if it is one, otherwise throws exception
Gets this value as a BsonMaxKey if it is one, otherwise throws exception
Gets this value as a BsonMinKey if it is one, otherwise throws exception
Gets this value as a BsonNull if it is one, otherwise throws exception
Gets this value as a BsonUndefined if it is one, otherwise throws exception
Gets this value as a BsonDateTime if it is one, otherwise throws exception
Gets this value as a BsonDBPointer if it is one, otherwise throws exception
Gets this value as a BsonDecimal128 if it is one, otherwise throws exception
Gets this value as a BsonDocument if it is one, otherwise throws exception
Gets this value as a BsonDouble if it is one, otherwise throws exception
Gets this value as a BsonJavaScript if it is one, otherwise throws exception
Gets this value as a BsonJavaScriptWithScope if it is one, otherwise throws exception
Gets this value as a BsonNumber if it is one, otherwise throws exception
Gets this value as an BsonObjectId if it is one, otherwise throws exception
Gets this value as a BsonRegularExpression if it is one, otherwise throws exception
Gets this value as a BsonString if it is one, otherwise throws exception
Gets this value as a BsonSymbol if it is one, otherwise throws exception
Gets this value as a BsonTimestamp if it is one, otherwise throws exception
Clone the document
Gets the value of the key if it is a BsonArray, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonArray.
Gets the value of the key if it is a BsonBinary, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonBinary.
Gets the value of the key if it is a BsonBoolean, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonBoolean.
Gets the value of the key if it is a BsonDateTime, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonDateTime.
Gets the value of the key if it is a BsonDecimal128, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonDecimal128.
Gets the value of the key if it is a BsonDocument, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonDocument.
Gets the value of the key if it is a BsonDouble, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonDouble.
Gets the first key in the document.
Gets the value of the key if it is a BsonInt32, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonInt32.
Gets the value of the key if it is a BsonInt64, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonInt64.
Gets the value of the key if it is a BsonNumber, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonNumber.
Gets the value of the key if it is a BsonObjectId, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonObjectId.
Gets the value of the key if it is a BsonRegularExpression, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonRegularExpression.
Gets the value of the key if it is a BsonString, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonString.
Gets the value of the key if it is a BsonTimestamp, or throws if not.
If the document does not contain the given key, return the given default value. Otherwise, gets the value of the key as a BsonTimestamp.
Returns true if the value of the key is a BsonDateTime, returns false if the document does not contain the key.
Returns true if the value of the key is a BsonDecimal128, returns false if the document does not contain the key.
Returns true if the value of the key is a BsonDocument, returns false if the document does not contain the key.
Returns true if the value of the key is a BsonObjectId, returns false if the document does not contain the key.
Returns true if the value of the key is a BsonTimestamp, returns false if the document does not contain the key.
Returns the Bson bytes for this document