Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1194

Support multiple --eval arguments

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • 1.5.1
    • CLI Module
    • None
    • 2
    • Needed
    • Hide
      mongosh will now accept --eval multiple times, e.g.

      mongosh --quiet --eval 'use mydb' --eval 'show collections' mongodb://localhost/

      would work now. The scripts are evaluated as if they were input to the shell, and can share variables etc.; only the result of the last --eval script is printed.
      Show
      mongosh will now accept --eval multiple times, e.g. mongosh --quiet --eval 'use mydb' --eval 'show collections' mongodb://localhost/ would work now. The scripts are evaluated as if they were input to the shell, and can share variables etc.; only the result of the last --eval script is printed.
    • Iteration Cuttlefish, Iteration Dolphin

    Description

      There is no reason why mongosh wouldn't be able to support multiple --eval arguments on the command line, and doing so allows easily running shell-like commands like use, show, snippet etc. in the syntaxes that users are familiar with.

      Attachments

        Activity

          People

            anna.henningsen@mongodb.com Anna Henningsen
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: