Table of Contents

Class EvalOperation

Namespace
MongoDB.Driver.Core.Operations
Assembly
MongoDB.Driver.Core.dll

Represents an eval operation.

public class EvalOperation : IWriteOperation<BsonValue>
Inheritance
EvalOperation
Implements
Inherited Members
Extension Methods

Constructors

EvalOperation(DatabaseNamespace, BsonJavaScript, MessageEncoderSettings)

Initializes a new instance of the EvalOperation class.

public EvalOperation(DatabaseNamespace databaseNamespace, BsonJavaScript function, MessageEncoderSettings messageEncoderSettings)

Parameters

databaseNamespace DatabaseNamespace

The database namespace.

function BsonJavaScript

The JavaScript function.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

Args

Gets or sets the arguments to the JavaScript function.

public IEnumerable<BsonValue> Args { get; set; }

Property Value

IEnumerable<BsonValue>

The arguments to the JavaScript function.

DatabaseNamespace

Gets the database namespace.

public DatabaseNamespace DatabaseNamespace { get; }

Property Value

DatabaseNamespace

The database namespace.

Function

Gets the JavaScript function.

public BsonJavaScript Function { get; }

Property Value

BsonJavaScript

The JavaScript function.

MaxTime

Gets or sets the maximum time the server should spend on this operation.

public TimeSpan? MaxTime { get; set; }

Property Value

TimeSpan?

The maximum time the server should spend on this operation.

MessageEncoderSettings

Gets the message encoder settings.

public MessageEncoderSettings MessageEncoderSettings { get; }

Property Value

MessageEncoderSettings

The message encoder settings.

NoLock

Gets or sets a value indicating whether the server should not take a global write lock before evaluating the JavaScript function.

public bool? NoLock { get; set; }

Property Value

bool?

A value indicating whether the server should not take a global write lock before evaluating the JavaScript function.

Methods

Execute(IWriteBinding, CancellationToken)

Executes the operation.

public BsonValue Execute(IWriteBinding binding, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

BsonValue

The result of the operation.

ExecuteAsync(IWriteBinding, CancellationToken)

Executes the operation.

public Task<BsonValue> ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<BsonValue>

A Task whose result is the result of the operation.