fixed bug in mongoMetricWriter.