trim hosts on mongo connection