Table of Contents

Class BsonValue

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON value (this is an abstract class, see the various subclasses).

public abstract class BsonValue : IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>
Inheritance
BsonValue
Implements
Derived
Inherited Members
Extension Methods

Properties

AsBoolean

Casts the BsonValue to a Boolean (throws an InvalidCastException if the cast is not valid).

AsBsonArray

Casts the BsonValue to a BsonArray (throws an InvalidCastException if the cast is not valid).

AsBsonBinaryData

Casts the BsonValue to a BsonBinaryData (throws an InvalidCastException if the cast is not valid).

AsBsonDateTime

Casts the BsonValue to a BsonDateTime (throws an InvalidCastException if the cast is not valid).

AsBsonDocument

Casts the BsonValue to a BsonDocument (throws an InvalidCastException if the cast is not valid).

AsBsonJavaScript

Casts the BsonValue to a BsonJavaScript (throws an InvalidCastException if the cast is not valid).

AsBsonJavaScriptWithScope

Casts the BsonValue to a BsonJavaScriptWithScope (throws an InvalidCastException if the cast is not valid).

AsBsonMaxKey

Casts the BsonValue to a BsonMaxKey (throws an InvalidCastException if the cast is not valid).

AsBsonMinKey

Casts the BsonValue to a BsonMinKey (throws an InvalidCastException if the cast is not valid).

AsBsonNull

Casts the BsonValue to a BsonNull (throws an InvalidCastException if the cast is not valid).

AsBsonRegularExpression

Casts the BsonValue to a BsonRegularExpression (throws an InvalidCastException if the cast is not valid).

AsBsonSymbol

Casts the BsonValue to a BsonSymbol (throws an InvalidCastException if the cast is not valid).

AsBsonTimestamp

Casts the BsonValue to a BsonTimestamp (throws an InvalidCastException if the cast is not valid).

AsBsonUndefined

Casts the BsonValue to a BsonUndefined (throws an InvalidCastException if the cast is not valid).

AsBsonValue

Casts the BsonValue to a BsonValue (a way of upcasting subclasses of BsonValue to BsonValue at compile time).

AsByteArray

Casts the BsonValue to a Byte[] (throws an InvalidCastException if the cast is not valid).

AsDecimal

Casts the BsonValue to a decimal (throws an InvalidCastException if the cast is not valid).

AsDecimal128

Casts the BsonValue to a Decimal128 (throws an InvalidCastException if the cast is not valid).

AsDouble

Casts the BsonValue to a Double (throws an InvalidCastException if the cast is not valid).

AsGuid

Casts the BsonValue to a Guid (throws an InvalidCastException if the cast is not valid).

AsInt32

Casts the BsonValue to an Int32 (throws an InvalidCastException if the cast is not valid).

AsInt64

Casts the BsonValue to a Int64 (throws an InvalidCastException if the cast is not valid).

AsLocalTime

Casts the BsonValue to a DateTime in the local timezone (throws an InvalidCastException if the cast is not valid).

AsNullableBoolean

Casts the BsonValue to a Nullable{Boolean} (throws an InvalidCastException if the cast is not valid).

AsNullableDecimal

Casts the BsonValue to a Nullable{Decimal} (throws an InvalidCastException if the cast is not valid).

AsNullableDecimal128

Casts the BsonValue to a Nullable{Decimal128} (throws an InvalidCastException if the cast is not valid).

AsNullableDouble

Casts the BsonValue to a Nullable{Double} (throws an InvalidCastException if the cast is not valid).

AsNullableGuid

Casts the BsonValue to a Nullable{Guid} (throws an InvalidCastException if the cast is not valid).

AsNullableInt32

Casts the BsonValue to a Nullable{Int32} (throws an InvalidCastException if the cast is not valid).

AsNullableInt64

Casts the BsonValue to a Nullable{Int64} (throws an InvalidCastException if the cast is not valid).

AsNullableLocalTime

Casts the BsonValue to a Nullable{DateTime} in the local timezone (throws an InvalidCastException if the cast is not valid).

AsNullableObjectId

Casts the BsonValue to a Nullable{ObjectId} (throws an InvalidCastException if the cast is not valid).

AsNullableUniversalTime

Casts the BsonValue to a Nullable{DateTime} in UTC (throws an InvalidCastException if the cast is not valid).

AsObjectId

Casts the BsonValue to an ObjectId (throws an InvalidCastException if the cast is not valid).

AsRegex

Casts the BsonValue to a Regex (throws an InvalidCastException if the cast is not valid).

AsString

Casts the BsonValue to a String (throws an InvalidCastException if the cast is not valid).

AsUniversalTime

Casts the BsonValue to a DateTime in UTC (throws an InvalidCastException if the cast is not valid).

BsonType

Gets the BsonType of this BsonValue.

IsBoolean

Tests whether this BsonValue is a Boolean.

IsBsonArray

Tests whether this BsonValue is a BsonArray.

IsBsonBinaryData

Tests whether this BsonValue is a BsonBinaryData.

IsBsonDateTime

Tests whether this BsonValue is a BsonDateTime.

IsBsonDocument

Tests whether this BsonValue is a BsonDocument.

IsBsonJavaScript

Tests whether this BsonValue is a BsonJavaScript.

IsBsonJavaScriptWithScope

Tests whether this BsonValue is a BsonJavaScriptWithScope.

IsBsonMaxKey

Tests whether this BsonValue is a BsonMaxKey.

IsBsonMinKey

Tests whether this BsonValue is a BsonMinKey.

IsBsonNull

Tests whether this BsonValue is a BsonNull.

IsBsonRegularExpression

Tests whether this BsonValue is a BsonRegularExpression.

IsBsonSymbol

Tests whether this BsonValue is a BsonSymbol .

IsBsonTimestamp

Tests whether this BsonValue is a BsonTimestamp.

IsBsonUndefined

Tests whether this BsonValue is a BsonUndefined.

IsDecimal128

Tests whether this BsonValue is a Decimal128.

IsDouble

Tests whether this BsonValue is a Double.

IsGuid

Tests whether this BsonValue is a Guid.

IsInt32

Tests whether this BsonValue is an Int32.

IsInt64

Tests whether this BsonValue is an Int64.

IsNumeric

Tests whether this BsonValue is a numeric value.

IsObjectId

Tests whether this BsonValue is an ObjectId .

IsString

Tests whether this BsonValue is a String.

IsValidDateTime

Tests whether this BsonValue is a valid DateTime.

this[int]

Gets or sets a value by position (only applies to BsonDocument and BsonArray).

this[string]

Gets or sets a value by name (only applies to BsonDocument).

Methods

Clone()

Creates a shallow clone of the BsonValue (see also DeepClone).

CompareTo(BsonValue)

Compares this BsonValue to another BsonValue.

CompareTypeTo(BsonValue)

Compares the type of this BsonValue to the type of another BsonValue.

Create(object)

Creates a new instance of the BsonValue class.

DeepClone()

Creates a deep clone of the BsonValue (see also Clone).

Equals(BsonValue)

Compares this BsonValue to another BsonValue.

Equals(object)

Compares this BsonValue to another object.

GetHashCode()

Gets the hash code.

IConvertibleGetTypeCodeImplementation()

Implementation of the IConvertible GetTypeCode method.

IConvertibleToBooleanImplementation(IFormatProvider)

Implementation of the IConvertible ToBoolean method.

IConvertibleToByteImplementation(IFormatProvider)

Implementation of the IConvertible ToByte method.

IConvertibleToCharImplementation(IFormatProvider)

Implementation of the IConvertible ToChar method.

IConvertibleToDateTimeImplementation(IFormatProvider)

Implementation of the IConvertible ToDateTime method.

IConvertibleToDecimalImplementation(IFormatProvider)

Implementation of the IConvertible ToDecimal method.

IConvertibleToDoubleImplementation(IFormatProvider)

Implementation of the IConvertible ToDouble method.

IConvertibleToInt16Implementation(IFormatProvider)

Implementation of the IConvertible ToInt16 method.

IConvertibleToInt32Implementation(IFormatProvider)

Implementation of the IConvertible ToInt32 method.

IConvertibleToInt64Implementation(IFormatProvider)

Implementation of the IConvertible ToInt64 method.

IConvertibleToSByteImplementation(IFormatProvider)

Implementation of the IConvertible ToSByte method.

IConvertibleToSingleImplementation(IFormatProvider)

Implementation of the IConvertible ToSingle method.

IConvertibleToStringImplementation(IFormatProvider)

Implementation of the IConvertible ToString method.

IConvertibleToUInt16Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt16 method.

IConvertibleToUInt32Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt32 method.

IConvertibleToUInt64Implementation(IFormatProvider)

Implementation of the IConvertible ToUInt64 method.

OperatorEqualsImplementation(BsonValue)

Implementation of operator ==.

ToBoolean()

Converts this BsonValue to a Boolean (using the JavaScript definition of truthiness).

ToDecimal()

Converts this BsonValue to a Decimal.

ToDecimal128()

Converts this BsonValue to a Decimal128.

ToDouble()

Converts this BsonValue to a Double.

ToInt32()

Converts this BsonValue to an Int32.

ToInt64()

Converts this BsonValue to an Int64.

ToLocalTime()

Converts this BsonValue to a DateTime in local time.

ToNullableLocalTime()

Converts this BsonValue to a DateTime? in local time.

ToNullableUniversalTime()

Converts this BsonValue to a DateTime? in UTC.

ToUniversalTime()

Converts this BsonValue to a DateTime in UTC.

Operators

operator ==(BsonValue, BsonValue)

Compares two BsonValues.

explicit operator Decimal128(BsonValue)

Casts a BsonValue to a Decimal128.

explicit operator ObjectId(BsonValue)

Casts a BsonValue to an ObjectId.

explicit operator bool(BsonValue)

Casts a BsonValue to a bool.

explicit operator byte[](BsonValue)

Casts a BsonValue to a byte[].

explicit operator DateTime(BsonValue)

Casts a BsonValue to a DateTime.

explicit operator decimal(BsonValue)

Casts a BsonValue to a decimal.

explicit operator double(BsonValue)

Casts a BsonValue to a double.

explicit operator Guid(BsonValue)

Casts a BsonValue to a Guid.

explicit operator int(BsonValue)

Casts a BsonValue to an int.

explicit operator long(BsonValue)

Casts a BsonValue to a long.

explicit operator Decimal128?(BsonValue)

Casts a BsonValue to a nullable Decimal128?.

explicit operator ObjectId?(BsonValue)

Casts a BsonValue to an ObjectId?.

explicit operator bool?(BsonValue)

Casts a BsonValue to a bool?.

explicit operator DateTime?(BsonValue)

Casts a BsonValue to a DateTime?.

explicit operator decimal?(BsonValue)

Casts a BsonValue to a decimal?.

explicit operator double?(BsonValue)

Casts a BsonValue to a double?.

explicit operator Guid?(BsonValue)

Casts a BsonValue to a Guid?.

explicit operator int?(BsonValue)

Casts a BsonValue to an int?.

explicit operator long?(BsonValue)

Casts a BsonValue to a long?.

explicit operator string(BsonValue)

Casts a BsonValue to a string.

explicit operator Regex(BsonValue)

Casts a BsonValue to a Regex.

operator >(BsonValue, BsonValue)

Compares two BsonValues.

operator >=(BsonValue, BsonValue)

Compares two BsonValues.

implicit operator BsonValue(Decimal128)

Converts a Decimal128 to a BsonValue.

implicit operator BsonValue(ObjectId)

Converts an ObjectId to a BsonValue.

implicit operator BsonValue(bool)

Converts a bool to a BsonValue.

implicit operator BsonValue(byte[])

Converts a byte[] to a BsonValue.

implicit operator BsonValue(DateTime)

Converts a DateTime to a BsonValue.

implicit operator BsonValue(decimal)

Converts a decimal to a BsonValue.

implicit operator BsonValue(double)

Converts a double to a BsonValue.

implicit operator BsonValue(Enum)

Converts an Enum to a BsonValue.

implicit operator BsonValue(int)

Converts an int to a BsonValue.

implicit operator BsonValue(long)

Converts a long to a BsonValue.

implicit operator BsonValue(Decimal128?)

Converts a nullable Decimal128 to a BsonValue.

implicit operator BsonValue(ObjectId?)

Converts an ObjectId? to a BsonValue.

implicit operator BsonValue(bool?)

Converts a bool? to a BsonValue.

implicit operator BsonValue(DateTime?)

Converts a DateTime? to a BsonValue.

implicit operator BsonValue(decimal?)

Converts a decimal? to a BsonValue.

implicit operator BsonValue(double?)

Converts a double? to a BsonValue.

implicit operator BsonValue(int?)

Converts an int? to a BsonValue.

implicit operator BsonValue(long?)

Converts a long? to a BsonValue.

implicit operator BsonValue(string)

Converts a string to a BsonValue.

implicit operator BsonValue(Regex)

Converts a Regex to a BsonValue.

operator !=(BsonValue, BsonValue)

Compares two BsonValues.

operator <(BsonValue, BsonValue)

Compares two BsonValues.

operator <=(BsonValue, BsonValue)

Compares two BsonValues.