Skip to content

Instantly share code, notes, and snippets.

@barrydobson
Created July 3, 2013 07:30
Show Gist options
  • Save barrydobson/5916094 to your computer and use it in GitHub Desktop.
Save barrydobson/5916094 to your computer and use it in GitHub Desktop.
public static MapReduceResult MapReduce(MongoCollection collection, IMongoQuery query, IMongoMapReduceOptions options, string name)
{
string map = GetMap(name);
string reduce = GetReduce(name);
string finalise = GetFinalise(name);
if (finalise != null)
{
MapReduceOptionsBuilder o = options as MapReduceOptionsBuilder;
o.SetFinalize(finalise);
}
if (query != null)
return collection.MapReduce(query, map, reduce, options);
else
return collection.MapReduce(map, reduce, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment