added mongodb writer and tests