Implement mongodb connection