[SERVER-4391] --eval should be affected by the --quiet switch Created: 30/Nov/11  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.1
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Paul D. Walker Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 3
Labels: commandline, move-sa, platforms-re-triaged, shell
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux 64 bit build


Issue Links:
Depends
Related
related to SERVER-27159 shell logs output of ReplicaSetMonito... Closed
is related to SERVER-23810 Don't Print Shell Log Messages to STD... Closed
Participants:

 Description   

when using the shell, the --quiet parameter does suppress the output from the --eval command

For example:

$ mongo <server>/db script.js --eval 'yyyymm="2011-11"'
MongoDB shell version: 2.0.1
connecting to: <server>/test
2011-11

Now with the --quiet parameter, the banner is suppressed, but eval seems to be adding output to stdout.

$ mongo <server>/db script.js --eval 'yyyymm="2011-11"' --quiet
2011-11

It'd be an improvement if the results of the --eval commend respected the --quiet flag.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Arun Madhavan [ 30/Mar/18 ]

Does prefixing with a void work?

For example:

$ mongo <server>/db script.js --eval 'void (yyyymm="2011-11")'

(NOTE: brackets are important)

Generated at Thu Feb 08 03:05:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.