Processing cache commands in mongo db.runCommand({closeAllDatabases:1})
1. Single command
@echo on
f:
cd \ mongo \ bin
echo db.runCommand({closeAllDatabases:1})| hly 127.0.0.1:27017/admin
pause
2. Multiple commands (tried it, and it died directly without effect)
mongo admin -u$user -p$pw <<EOF Order Order EOF $user user $pw password If user authentication is not set, then the following -u and -p do not need to be added.
echo plus pipe character to pass the command into mongo's command line echo "db.serverStatus().mem" | mongo admin -u$user -p$pw