When using Meteoric to start the meteor app that connects to a mongodb server that has auth enabled, first the variable is set:
export MONGO_URL = mongodb://admin:password@localhost:27017/myAppDb
Meteoric is configured as shown:
PRE_METEOR_START="export ENVIRONMENT=prod MONGO_URL=mongodb://admin:password@localhost:27017/myAppDb;"
Then meteor is launched using the command meteoric deploy
The error appears:
MongoError: auth fails
Question: Why is meteor unable to access mongodb using meteoric deploy
, but when launching meteor using mrt
, mongodb access works fine?
I do notice that the Meteoric script contains the following code, what does the -z
flag do?
if [ -z "$MONGO_URL" ]; then
MONGO_URL=mongodb://localhost:27017/$APP_NAME