Class BsonJavaScript
Represents a BSON JavaScript value.
[Serializable]
public class BsonJavaScript : BsonValue, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonJavaScript>, IEquatable<BsonJavaScript>
- Inheritance
-
BsonJavaScript
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
BsonJavaScript(string)
Initializes a new instance of the BsonJavaScript class.
public BsonJavaScript(string code)
Parameters
codestringThe JavaScript code.
Properties
BsonType
Gets the BsonType of this BsonValue.
public override BsonType BsonType { get; }
Property Value
Code
Gets the JavaScript code.
public string Code { get; }
Property Value
Methods
CompareTo(BsonJavaScript)
Compares this BsonJavaScript to another BsonJavaScript.
public int CompareTo(BsonJavaScript other)
Parameters
otherBsonJavaScriptThe other BsonJavaScript.
Returns
- int
A 32-bit signed integer that indicates whether this BsonJavaScript is less than, equal to, or greather than the other.
CompareTo(BsonValue)
Compares the BsonJavaScript to another BsonValue.
public override int CompareTo(BsonValue other)
Parameters
otherBsonValueThe other BsonValue.
Returns
- int
A 32-bit signed integer that indicates whether this BsonJavaScript is less than, equal to, or greather than the other BsonValue.
Create(object)
Creates a new BsonJavaScript.
public static BsonJavaScript Create(object value)
Parameters
valueobjectAn object to be mapped to a BsonJavaScript.
Returns
- BsonJavaScript
A BsonJavaScript or null.
Equals(BsonJavaScript)
Compares this BsonJavaScript to another BsonJavaScript.
public bool Equals(BsonJavaScript rhs)
Parameters
rhsBsonJavaScriptThe other BsonJavaScript.
Returns
- bool
True if the two BsonJavaScript values are equal.
Equals(object)
Compares this BsonJavaScript to another object.
public override bool Equals(object obj)
Parameters
objobjectThe other object.
Returns
- bool
True if the other object is a BsonJavaScript 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 ==(BsonJavaScript, BsonJavaScript)
Compares two BsonJavaScript values.
public static bool operator ==(BsonJavaScript lhs, BsonJavaScript rhs)
Parameters
lhsBsonJavaScriptThe first BsonJavaScript.
rhsBsonJavaScriptThe other BsonJavaScript.
Returns
- bool
True if the two BsonJavaScript values are equal according to ==.
implicit operator BsonJavaScript(string)
Converts a string to a BsonJavaScript.
public static implicit operator BsonJavaScript(string code)
Parameters
codestringA string.
Returns
- BsonJavaScript
A BsonJavaScript.
operator !=(BsonJavaScript, BsonJavaScript)
Compares two BsonJavaScript values.
public static bool operator !=(BsonJavaScript lhs, BsonJavaScript rhs)
Parameters
lhsBsonJavaScriptThe first BsonJavaScript.
rhsBsonJavaScriptThe other BsonJavaScript.
Returns
- bool
True if the two BsonJavaScript values are not equal according to ==.