generalize mongodb connection string

includes urls containing \W characters

cc @quasiben