Struct MetadataValue
Holds one application data value whose nested contents are also immutable.
public readonly struct MetadataValue : IEquatable<MetadataValue>
- Implements
- Inherited Members
Remarks
Although integers share one signed 64 bit kind, BSON encoding chooses the canonical 32 or 64 bit width. Values supported by only one wire format need a separate raw representation and are not accepted here.
Properties
ArrayValue
public IReadOnlyList<MetadataValue> ArrayValue { get; }
Property Value
BooleanValue
public bool BooleanValue { get; }
Property Value
DocumentValue
public MetadataDocument DocumentValue { get; }
Property Value
DoubleValue
public double DoubleValue { get; }
Property Value
IntegerValue
public long IntegerValue { get; }
Property Value
Kind
public MetadataValueKind Kind { get; }
Property Value
Null
public static MetadataValue Null { get; }
Property Value
StringValue
public string StringValue { get; }
Property Value
Methods
Equals(MetadataValue)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MetadataValue other)
Parameters
otherMetadataValueAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
From(MetadataDocument)
public static MetadataValue From(MetadataDocument value)
Parameters
valueMetadataDocument
Returns
From(bool)
public static MetadataValue From(bool value)
Parameters
valuebool
Returns
From(IEnumerable<MetadataValue>)
public static MetadataValue From(IEnumerable<MetadataValue> values)
Parameters
valuesIEnumerable<MetadataValue>
Returns
From(double)
public static MetadataValue From(double value)
Parameters
valuedouble
Returns
From(int)
public static MetadataValue From(int value)
Parameters
valueint
Returns
From(long)
public static MetadataValue From(long value)
Parameters
valuelong
Returns
From(string)
public static MetadataValue From(string value)
Parameters
valuestring
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
TryGetInt32(out int)
Tries to read an integer whose value fits the signed 32-bit range.
public bool TryGetInt32(out int value)
Parameters
valueint
Returns
Operators
operator ==(MetadataValue, MetadataValue)
public static bool operator ==(MetadataValue left, MetadataValue right)
Parameters
leftMetadataValuerightMetadataValue
Returns
operator !=(MetadataValue, MetadataValue)
public static bool operator !=(MetadataValue left, MetadataValue right)
Parameters
leftMetadataValuerightMetadataValue