Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2543

Don't "echo" to script the mongo javascript shell

    XMLWordPrintableJSON

Details

    Description

      re:http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/#differences-between-interactive-and-scripted-mongo

      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.

      Attachments

        Activity

          People

            andrew.feierabend@mongodb.com Andrew Feierabend (Inactive)
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 19 weeks, 1 day ago