So I’m finding that the problem is definitely with the ‘&’ char in the string.
From Mongodb:
SEMI-COLON SEPARATOR FOR CONNECTION STRING ARGUMENTS
To provide backwards compatibility, drivers currently accept semi-colons (i.e. ;) as option separators.
https://docs.mongodb.com/manual/reference/connection-string/
So when I replace ‘&’ with ‘;’ the var is set and I can do:
echo "$MONGO_URL"
and it gives me the URL up to the first ';'
If I pass the string with ‘&’ the var is not set at all. So how can I set all the options since ‘;’ is only setting the first option? (i.e. /database?ssl=true - and the rest don’t follow) Sorry I’m a noob to bash.