MongoDB Shell
3 results found
-
add _prettyShell=false to mongosh
In 4.4, the mongo shell prints 'ugly' by default. Many of our scripts are written to expect this type of output. The mongo shell includes the command: DBQuery.prototype._prettyShell=false to explicitly set this. In mongosh, there is no built in/native ability to achieve the same output as mongo shell.
1 vote -
Change mongosh to process and use arguments only up to a "--" sentinel
Getting command line arguments into mongosh is virtually impossible. The --eval option insists on printing the last eval expr evaluated to the console despite the --quiet switch. Allowing a script to self parse and manage any args following the "–" sentinel using the "process.argv" array would permit the developer a wide array of choices in handling script input from a command line.
" > mongosh mongo-options script file – arg arg... "
Component: mongosh
Versions: 1.4.x and up
1 vote -
Suggest new feature for loading scripts: loadScript and loadFolder
For loading external script into MongoSh current session, currently we have the
load()
function, which is enough for the task. But I found myself using my own functions instead. So I would like to describe those as suggestion to improve MongoSh:loadScript()
This function is basically has the same function with
load()
. But has 1 major difference: all relative paths in the script has the same base directory with the script itself, not the current MongoSh working directory.
For example:
- Script"D:\MyProject\src\script.js"
have these references:"test.js"
,"../test2.js"
- Current working dirprocess.cwd()
:"C:\MongoSh"
- Path resolved…1 vote
- Don't see your idea?