Building the mongo url dynamically.