updating mapreduce mongo logic