If you see something like this on CircleCI builds:
/bin/bash: mongo: command not found
This is because all of your commands will run in the first container that is listed (primary container). This is typically not the database container, which means that the
mongo cli is likely not installed in the primary container. The same can happen for mysql and postgresql.
In these cases you can install the client using
sudo apt install or the relevant package manager for the distro your image is running.
- run: sudo apt-get install mongodb-clients
More details on Discuss here: https://discuss.circleci.com/t/bin-bash-mongo-command-not-found/16218/6