MongoDB Shell
-
Vi mode for MongoDB Shell
Please enable a 'vi' editing mode for the mongo shell.
- Similar to vi mode in bash
- Similar to https://www.npmjs.com/package/mongovi
A first cut of key bindings would be:
Basic command mode/editing mode toggling:
i Insert before cursor
Esc Toggle to command modeCursor motion keys:
h Move left
j Move down
k Move up
l Move rightw Move to next word
b Move to the beginning of the word0 Move to the beginning of the line
$ Move to the end of the lineAnd delete/change:
x delete next character to the right
d{motion} delete amount specified by…
8 votes -
Support .mongorc.js file
A core bit of functionality from the original shell is to support reading from the
.mongorc.js
file in a user's home directory. This feels like core functionality thatmongosh
should support.4 votesThis work is planned. Support for `.mongorc.js` will be there before GA `mongosh`.
-
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 -
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 -
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 -
Option to show date in local timezone
Currently MongoDB is storing date and time in UTC - which is good and should be that way.
However, from the presentation (either via Compass/Shell), there should be a way to show the date and time based on locale time zone settings or an option to switch from UTC to local time zone.So for people who consume data right from MongoDB, they don't get confused with the data differences between UTC and their local time zone.
1 vote
- Don't see your idea?