MongoDB Shell
-
Ability to execute a javascript file from inside the shell
Currently the only way to execute a javascript file from the mongo shell is to re-direct the input at shell login time (e.g. mongo --username <username> ... < myscript.js). It would be helpful to have a way to execute the script from inside the shell via some sort of "run" command (e.g.from inside the shell "run /my/path/myscript.js".
4 votes -
create custom role with list of collection
currently, when creating a role, we need to list one collection per db for custom role
db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY',
privileges : [ {resource : {db : "database_A", collection : "***"}, actions : ["find", "insert", "update"]},{resource : {db : "database_A", collection : "yyy"}, actions : ["find", "insert", "update"]} ],
roles : []
})having an option to list all the collections in one db with the same permission would be a nice thing to have.
db.getSisterDB('admin').createRole({role : 'readWriteCollectionXY',
privileges : [ {resource : {db : "database_A", collections : ["***", "yyy"] }, actions : ["find", "insert", "update"]} ],
roles : [] …1 vote -
Explain shell helpers for CRUD API
The .explain() method in the shell works with some write methods (update, remove, findAndModify), but it doesn't work with the newer CRUD API.
The missing explain methods are:
"deleteMany",
"deleteOne",
"findOne",
"findOneAndDelete",
"findOneAndReplace",
"findOneAndUpdate",
"insertMany",
"insertOne",
"replaceOne",
"updateMany",
"updateOne"I think this would be especially helpful for new hires: explain is a good way to quickly find the code that implements a command.
1 vote -
Edit command like the old mongo shell has
It would be nice to have the edit feature of the old mongo shell https://docs.mongodb.com/manual/tutorial/configure-mongo-shell/#use-an-external-editor-in-the-mongo-shell
2 votes -
creating an option to import csv files with semicolon separator
There isn't an option to specify semicolon as delimiter on mongo shell when importing csv files. We are forced to import through MongoDB Compass when file has semicolon separator.
2 votes
- Don't see your idea?