internal void RetrieveData()
{
if(Command.Command.ContainsKey("map") == false || Command.Command.ContainsKey("reduce") == false)
throw new InvalidOperationException("Cannot execute without a map and reduce function");
IsModifiable = false;
try
{
Result = new MapReduceResult(_database.SendCommand(_rootType, Command.Command));
}
catch(MongoCommandException exception)
{
Result = new MapReduceResult(exception.Error);
throw new MongoMapReduceException(exception);
}
}