updated mongodb connection adapter