added mongodb output support.