C# Class MongoDB.Driver.MapReduceBuilder

Provides a Fluent interface to build and execute Map/Reduce calls.
Inheritance: IDisposable
Show file Open project: sdether/mongodb-csharp Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
Execute ( ) : MapReduce
Finalize ( Code function ) : MapReduceBuilder

Function to apply to all the results when finished.

KeepTemp ( bool keep ) : MapReduceBuilder

When true the generated collection is not treated as temporary. Specifying out automatically makes the collection permanent

Limit ( long limit ) : MapReduceBuilder

Number of objects to return from collection

Map ( Code function ) : MapReduceBuilder

The map function references the variable this to inspect the current object under consideration. A map function must call emit(key,value) at least once, but may be invoked any number of times, as may be appropriate.

Map ( string function ) : MapReduceBuilder

The map function references the variable this to inspect the current object under consideration. A map function must call emit(key,value) at least once, but may be invoked any number of times, as may be appropriate.

MapReduceBuilder ( MapReduce mr ) : System
Out ( String name ) : MapReduceBuilder

Name of the final collection the results should be stored in.

A temporary collection is still used and then renamed to the target name atomically.

Query ( Document query ) : MapReduceBuilder

Query filter object

Reduce ( Code function ) : MapReduceBuilder

The reduce function receives a key and an array of values. To use, reduce the received values, and return a result.

The MapReduce engine may invoke reduce functions iteratively; thus, these functions must be idempotent. If you need to perform an operation only once, use a finalize function.

Reduce ( string function ) : MapReduceBuilder

The reduce function receives a key and an array of values. To use, reduce the received values, and return a result.

The MapReduce engine may invoke reduce functions iteratively; thus, these functions must be idempotent. If you need to perform an operation only once, use a finalize function.

Scope ( Document scope ) : MapReduceBuilder

Document where fields go into javascript global scope

Sort ( Document sort ) : MapReduceBuilder

Sort the query. Useful for optimization

Verbose ( bool val ) : MapReduceBuilder

Provides statistics on job execution time.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Execute() public method

public Execute ( ) : MapReduce
return MapReduce

Finalize() public method

Function to apply to all the results when finished.
public Finalize ( Code function ) : MapReduceBuilder
function Code
return MapReduceBuilder

KeepTemp() public method

When true the generated collection is not treated as temporary. Specifying out automatically makes the collection permanent
public KeepTemp ( bool keep ) : MapReduceBuilder
keep bool
return MapReduceBuilder

Limit() public method

Number of objects to return from collection
public Limit ( long limit ) : MapReduceBuilder
limit long
return MapReduceBuilder

Map() public method

The map function references the variable this to inspect the current object under consideration. A map function must call emit(key,value) at least once, but may be invoked any number of times, as may be appropriate.
public Map ( Code function ) : MapReduceBuilder
function Code
return MapReduceBuilder

Map() public method

The map function references the variable this to inspect the current object under consideration. A map function must call emit(key,value) at least once, but may be invoked any number of times, as may be appropriate.
public Map ( string function ) : MapReduceBuilder
function string
return MapReduceBuilder

MapReduceBuilder() public method

public MapReduceBuilder ( MapReduce mr ) : System
mr MapReduce
return System

Out() public method

Name of the final collection the results should be stored in.
A temporary collection is still used and then renamed to the target name atomically.
public Out ( String name ) : MapReduceBuilder
name String
return MapReduceBuilder

Query() public method

Query filter object
public Query ( Document query ) : MapReduceBuilder
query Document
return MapReduceBuilder

Reduce() public method

The reduce function receives a key and an array of values. To use, reduce the received values, and return a result.
The MapReduce engine may invoke reduce functions iteratively; thus, these functions must be idempotent. If you need to perform an operation only once, use a finalize function.
public Reduce ( Code function ) : MapReduceBuilder
function Code
return MapReduceBuilder

Reduce() public method

The reduce function receives a key and an array of values. To use, reduce the received values, and return a result.
The MapReduce engine may invoke reduce functions iteratively; thus, these functions must be idempotent. If you need to perform an operation only once, use a finalize function.
public Reduce ( string function ) : MapReduceBuilder
function string
return MapReduceBuilder

Scope() public method

Document where fields go into javascript global scope
public Scope ( Document scope ) : MapReduceBuilder
scope Document
return MapReduceBuilder

Sort() public method

Sort the query. Useful for optimization
public Sort ( Document sort ) : MapReduceBuilder
sort Document
return MapReduceBuilder

Verbose() public method

Provides statistics on job execution time.
public Verbose ( bool val ) : MapReduceBuilder
val bool
return MapReduceBuilder