Table of Contents

Class BsonJavaScript

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

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 string

The JavaScript code.

Properties

BsonType

Gets the BsonType of this BsonValue.

public override BsonType BsonType { get; }

Property Value

BsonType

Code

Gets the JavaScript code.

public string Code { get; }

Property Value

string

Methods

CompareTo(BsonJavaScript)

Compares this BsonJavaScript to another BsonJavaScript.

public int CompareTo(BsonJavaScript other)

Parameters

other BsonJavaScript

The 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 BsonValue

The 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 object

An 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 BsonJavaScript

The 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 object

The 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 BsonJavaScript

The first BsonJavaScript.

rhs BsonJavaScript

The 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 string

A string.

Returns

BsonJavaScript

A BsonJavaScript.

operator !=(BsonJavaScript, BsonJavaScript)

Compares two BsonJavaScript values.

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

Parameters

lhs BsonJavaScript

The first BsonJavaScript.

rhs BsonJavaScript

The other BsonJavaScript.

Returns

bool

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