public MapReduce Execute() { if (cmd.Contains("map") == false || cmd.Contains("reduce") == false) { throw new InvalidOperationException("Cannot execute without a map and reduce function"); } canModify = false; try{ result = new MapReduce.MapReduceResult(db.SendCommand(cmd)); }catch (MongoCommandException mce) { result = new MapReduce.MapReduceResult(mce.Error); throw new MongoMapReduceException(mce, this); } return(this); }
public MapReduce Execute() { if(cmd.Contains("map") == false || cmd.Contains("reduce") == false){ throw new InvalidOperationException("Cannot execute without a map and reduce function"); } canModify = false; try{ result = new MapReduce.MapReduceResult(db.SendCommand(cmd)); }catch(MongoCommandException mce){ result = new MapReduce.MapReduceResult(mce.Error); throw new MongoMapReduceException(mce, this); } return this; }