Support multiple --eval arguments

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 1.5.1
    • Affects Version/s: None
    • Component/s: CLI Module
    • None
    • 2
    • Iteration Cuttlefish, Iteration Dolphin
    • 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.

      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.

              Assignee:
              Anna Henningsen
              Reporter:
              Anna Henningsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: