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
code
stringThe 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
other
BsonJavaScriptThe 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
other
BsonValueThe 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
value
objectAn 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
rhs
BsonJavaScriptThe 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
obj
objectThe 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
lhs
BsonJavaScriptThe first BsonJavaScript.
rhs
BsonJavaScriptThe 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
code
stringA string.
Returns
- BsonJavaScript
A BsonJavaScript.
operator !=(BsonJavaScript, BsonJavaScript)
Compares two BsonJavaScript values.
public static bool operator !=(BsonJavaScript lhs, BsonJavaScript rhs)
Parameters
lhs
BsonJavaScriptThe first BsonJavaScript.
rhs
BsonJavaScriptThe other BsonJavaScript.
Returns
- bool
True if the two BsonJavaScript values are not equal according to ==.