Stop writing when mongodb disabled