I want to execute mongo commands in shell script.
I tried following way test.sh
#!/bin/sh
mongo myDbName
db.mycollection.findOne()
show collections
When I execute above script ./test.sh
Then mongo connection established but next commands not executed
How to execute other commands through sh script [test.sh] ?
Please help me
In my setup I have to use: