Table of Contents

Class BsonJavaScriptWithScope

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Represents a BSON JavaScript value with a scope.

[Serializable]
public class BsonJavaScriptWithScope : BsonJavaScript, IComparable<BsonValue>, IConvertible, IEquatable<BsonValue>, IComparable<BsonJavaScript>, IEquatable<BsonJavaScript>, IComparable<BsonJavaScriptWithScope>, IEquatable<BsonJavaScriptWithScope>
Inheritance
BsonJavaScriptWithScope
Implements
Inherited Members
Extension Methods

Constructors

BsonJavaScriptWithScope(string, BsonDocument)

Initializes a new instance of the BsonJavaScriptWithScope class.

public BsonJavaScriptWithScope(string code, BsonDocument scope)

Parameters

code string

The JavaScript code.

scope BsonDocument

A scope (a set of variables with values).

Properties

BsonType

Gets the BsonType of this BsonValue.

public override BsonType BsonType { get; }

Property Value

BsonType

Scope

Gets the scope (a set of variables with values).

public BsonDocument Scope { get; }

Property Value

BsonDocument

Methods

Clone()

Creates a shallow clone of the BsonJavaScriptWithScope (see also DeepClone).

public override BsonValue Clone()

Returns

BsonValue

A shallow clone of the BsonJavaScriptWithScope.

CompareTo(BsonJavaScriptWithScope)

Compares this BsonJavaScriptWithScope to another BsonJavaScriptWithScope.

public int CompareTo(BsonJavaScriptWithScope other)

Parameters

other BsonJavaScriptWithScope

The other BsonJavaScriptWithScope.

Returns

int

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

CompareTo(BsonValue)

Compares the BsonJavaScriptWithScope 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 BsonJavaScriptWithScope is less than, equal to, or greather than the other BsonValue.

Create(object)

Creates a new BsonJavaScriptWithScope.

public static BsonJavaScriptWithScope Create(object value)

Parameters

value object

An object to be mapped to a BsonJavaScriptWithScope.

Returns

BsonJavaScriptWithScope

A BsonJavaScriptWithScope or null.

DeepClone()

Creates a deep clone of the BsonJavaScriptWithScope (see also Clone).

public override BsonValue DeepClone()

Returns

BsonValue

A deep clone of the BsonJavaScriptWithScope.

Equals(BsonJavaScriptWithScope)

Compares this BsonJavaScriptWithScope to another BsonJavaScriptWithScope.

public bool Equals(BsonJavaScriptWithScope rhs)

Parameters

rhs BsonJavaScriptWithScope

The other BsonJavaScriptWithScope.

Returns

bool

True if the two BsonJavaScriptWithScope values are equal.

Equals(object)

Compares this BsonJavaScriptWithScope to another object.

public override bool Equals(object obj)

Parameters

obj object

The other object.

Returns

bool

True if the other object is a BsonJavaScriptWithScope 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 ==(BsonJavaScriptWithScope, BsonJavaScriptWithScope)

Compares two BsonJavaScriptWithScope values.

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

Parameters

lhs BsonJavaScriptWithScope

The first BsonJavaScriptWithScope.

rhs BsonJavaScriptWithScope

The other BsonJavaScriptWithScope.

Returns

bool

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

operator !=(BsonJavaScriptWithScope, BsonJavaScriptWithScope)

Compares two BsonJavaScriptWithScope values.

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

Parameters

lhs BsonJavaScriptWithScope

The first BsonJavaScriptWithScope.

rhs BsonJavaScriptWithScope

The other BsonJavaScriptWithScope.

Returns

bool

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