Table of Contents

Class BsonSymbol

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON symbol value.

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

Properties

BsonType

Gets the BsonType of this BsonValue.

public override BsonType BsonType { get; }

Property Value

BsonType

Name

Gets the name of the symbol.

public string Name { get; }

Property Value

string

Methods

CompareTo(BsonSymbol)

Compares this BsonSymbol to another BsonSymbol.

public int CompareTo(BsonSymbol other)

Parameters

other BsonSymbol

The other BsonSymbol.

Returns

int

A 32-bit signed integer that indicates whether this BsonSymbol is less than, equal to, or greather than the other.

CompareTo(BsonValue)

Compares the BsonSymbol to another BsonValue.

public override int CompareTo(BsonValue other)

Parameters

other BsonValue

The other BsonValue.

Returns

int

A 32-bit signed integer that indicates whether this BsonSymbol is less than, equal to, or greather than the other BsonValue.

Create(object)

Creates a new BsonSymbol.

public static BsonSymbol Create(object value)

Parameters

value object

An object to be mapped to a BsonSymbol.

Returns

BsonSymbol

A BsonSymbol or null.

Equals(BsonSymbol)

Compares this BsonSymbol to another BsonSymbol.

public bool Equals(BsonSymbol rhs)

Parameters

rhs BsonSymbol

The other BsonSymbol.

Returns

bool

True if the two BsonSymbol values are equal.

Equals(object)

Compares this BsonSymbol to another object.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

True if the other object is a BsonSymbol and equal to this one.

GetHashCode()

Gets the hash code.

public override int GetHashCode()

Returns

int

The hash code.

ToString()

Returns a string representation of the value.

public override string ToString()

Returns

string

A string representation of the value.

Operators

operator ==(BsonSymbol, BsonSymbol)

Compares two BsonSymbol values.

public static bool operator ==(BsonSymbol lhs, BsonSymbol rhs)

Parameters

lhs BsonSymbol

The first BsonSymbol.

rhs BsonSymbol

The other BsonSymbol.

Returns

bool

True if the two BsonSymbol values are equal according to ==.

implicit operator BsonSymbol(string)

Converts a string to a BsonSymbol.

public static implicit operator BsonSymbol(string name)

Parameters

name string

A string.

Returns

BsonSymbol

A BsonSymbol.

operator !=(BsonSymbol, BsonSymbol)

Compares two BsonSymbol values.

public static bool operator !=(BsonSymbol lhs, BsonSymbol rhs)

Parameters

lhs BsonSymbol

The first BsonSymbol.

rhs BsonSymbol

The other BsonSymbol.

Returns

bool

True if the two BsonSymbol values are not equal according to ==.