MongoDB

MongoDB

MongoDB Check validates connectivity to a MongoDB instance.

Usage with Binary

./wait4it -type=mongo -h=127.0.0.1 -p=27017 -t=60 -u=mongoadmin -P=secret

Usage with Docker

docker run ph4r5h4d/wait4it -type=mongo -h=127.0.0.1 -p=27017 -t=60 -u=mongoadmin -P=secret

Environment Variables

VariableDescriptionDefault
W4IT_TYPEThe type of check (set to mongo for MongoDB check).-
W4IT_TIMEOUTTimeout in seconds.30
W4IT_HOSTThe host to check.127.0.0.1
W4IT_PORTThe port to check on the MongoDB host.27017
W4IT_USERNAMEThe username for MongoDB authentication.-
W4IT_PASSWORDThe password for MongoDB authentication.-

Command-Line Arguments

ArgumentDescriptionDefault
-typeThe type of check (set to mongo).-
-tTimeout in seconds.30
-hThe host to check.127.0.0.1
-pThe port to check on the MongoDB host.27017
-uThe username for MongoDB authentication.-
-PThe password for MongoDB authentication.-

Notes

ℹ️
  • Environment variables override command-line arguments.
  • Currently, only username/password authentication mechanism is supported.

Exit Codes

CodeMeaning
0Connection successful.
1Timed out.
2Validation error or incorrect input.