shell里执行mongodb命令

 

[root@localhost scripts]# more run_mongodb_cmd.sh 
#!/bin/bash
/usr/local/services/mongodb/bin/mongo localhost:28001 << EOF
use admin
db.auth("root","123456");
db.serverStatus();
EOF

 

posted @ 2024-01-23 14:47  slnngk  阅读(77)  评论(0编辑  收藏  举报