通过 shell 脚本进行远程 Mongo 数据库连接

Remote Mongo DB connection through shell scripts

我必须通过 shell 脚本建立与远程 mongo 数据库的连接,并使用 mongo 查询执行 js 文件 请帮助我使用命令..

总的来说:

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