Exportv4 cs mongodb into es

Rather than calling os.Getenv("JUJU_TEST_ELASTICSEARCH") three times in this function,
I suggest saving the result in a variable, say esAddr.