Search code examples
linuxmongodbshellconnectionsh

Remote Mongo DB connection through shell scripts


I have to establish connection to Remote mongo database through shell script and execute a js file with mongo queries Please help me with the commands..


Solution

  • In general:

     mongo mongodb://user:<pass>@<ip>:27017/test&authSource=admin myjsfile.js