premaseem.wordpress.com
How to execute mongo commands through shell
Lets say you need to find out which is the primary node in the mongo cluster in your shell script, mongo –host 10.126.71.162 –username=userid –password=secret –eval “d…