허당 레몬도리

What you want is:

 mongo sm-repository2.db.qa.test.com:27017/testdb --eval "db.stats()"

Or for longer scripts:

 mongo sm-repository2.db.qa.test.com:27017/testdb script.js


출처 : http://stackoverflow.com/questions/4837673/how-to-execute-mongo-commands-through-shell-scripts

profile

허당 레몬도리

@LemonDory

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!