optimize and add mongodb data sink.