Backport direct mongo writer