Table of Contents

Method Eval

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

Eval(EvalFlags, BsonJavaScript, params object[])

Evaluates JavaScript code at the server.

[Obsolete("Use the overload of Eval that has an EvalArgs parameter instead.")]
public virtual BsonValue Eval(EvalFlags flags, BsonJavaScript code, params object[] args)

Parameters

flags EvalFlags

Flags that control Eval options.

code BsonJavaScript

The code to evaluate.

args object[]

Optional arguments (only used when the code is a function with parameters).

Returns

BsonValue

The result of evaluating the code.

Eval(BsonJavaScript, params object[])

Evaluates JavaScript code at the server.

[Obsolete("Use the overload of Eval that has an EvalArgs parameter instead.")]
public virtual BsonValue Eval(BsonJavaScript code, params object[] args)

Parameters

code BsonJavaScript

The code to evaluate.

args object[]

Optional arguments (only used when the code is a function with parameters).

Returns

BsonValue

The result of evaluating the code.

Eval(EvalArgs)

Evaluates JavaScript code at the server.

public virtual BsonValue Eval(EvalArgs args)

Parameters

args EvalArgs

The args.

Returns

BsonValue

The result of evaluating the code.