Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
*Location*: http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/#differences-between-interactive-and-scripted-mongo
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0
*Screen Resolution*: 1920 x 1200
*repo*: docs
*source*: tutorial/write-scripts-for-the-mongo-shell
*Location*: http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/#differences-between-interactive-and-scripted-mongo *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0 *Screen Resolution*: 1920 x 1200 *repo*: docs *source*: tutorial/write-scripts-for-the-mongo-shell
-
0.25
Description
We should add a warning that it is not advised to use things like:
echo "db.currentOp()" >> mongo ...
because that runs in interactive mode and does extra, possibly bad things when being automated – runs commands like gle, isMaster, replSetGetStatus, etc.
Instead, the suggestion is to use --eval or js-file, which is much better.