edit map reduce query