Created
December 20, 2012 06:23
-
-
Save jiangzhuo/4343299 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<T> MapReduce(Expression<Func<T, bool>> predicate,string mapString,string reduceString) | |
{ | |
var query = ((MongoQueryable<T>)this.collection.AsQueryable<T>().Where(predicate)).GetMongoQuery(); | |
var mrResult = this.collection.MapReduce(query, new BsonJavaScript(mapString), new BsonJavaScript(reduceString)); | |
return mrResult.GetInlineResultsAs<T>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment