Table of Contents

Struct MetadataValue

Namespace
Shard.Codecs
Assembly
Shard.Codecs.dll

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

IReadOnlyList<MetadataValue>

BooleanValue

public bool BooleanValue { get; }

Property Value

bool

DocumentValue

public MetadataDocument DocumentValue { get; }

Property Value

MetadataDocument

DoubleValue

public double DoubleValue { get; }

Property Value

double

IntegerValue

public long IntegerValue { get; }

Property Value

long

Kind

public MetadataValueKind Kind { get; }

Property Value

MetadataValueKind

Null

public static MetadataValue Null { get; }

Property Value

MetadataValue

StringValue

public string StringValue { get; }

Property Value

string

Methods

Equals(MetadataValue)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(MetadataValue other)

Parameters

other MetadataValue

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

From(MetadataDocument)

public static MetadataValue From(MetadataDocument value)

Parameters

value MetadataDocument

Returns

MetadataValue

From(bool)

public static MetadataValue From(bool value)

Parameters

value bool

Returns

MetadataValue

From(IEnumerable<MetadataValue>)

public static MetadataValue From(IEnumerable<MetadataValue> values)

Parameters

values IEnumerable<MetadataValue>

Returns

MetadataValue

From(double)

public static MetadataValue From(double value)

Parameters

value double

Returns

MetadataValue

From(int)

public static MetadataValue From(int value)

Parameters

value int

Returns

MetadataValue

From(long)

public static MetadataValue From(long value)

Parameters

value long

Returns

MetadataValue

From(string)

public static MetadataValue From(string value)

Parameters

value string

Returns

MetadataValue

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

value int

Returns

bool

Operators

operator ==(MetadataValue, MetadataValue)

public static bool operator ==(MetadataValue left, MetadataValue right)

Parameters

left MetadataValue
right MetadataValue

Returns

bool

operator !=(MetadataValue, MetadataValue)

public static bool operator !=(MetadataValue left, MetadataValue right)

Parameters

left MetadataValue
right MetadataValue

Returns

bool