Open IntelliShell – Ctrl + L (⌘+ L)
Trigger auto-completion – Ctrl + Space (^ + Space)
Find – Ctrl + F (⌘+ F)
Replace – Ctrl + H (Shift + ⌘ + F)
Comment with line comment – Ctrl + / (⌘+ /)
Open script – Ctrl + O (⌘+ O)
Save script – Ctrl + S (⌘+ S)
Save script as – Shift + Ctrl + S (Shift + ⌘+ S)
Execute entire script – F5
Execute statement at cursor – F6
Execute selection – F9
Download Studio 3T and choose the right version for your particular platform and bit size.
IntelliShell requires the mongo shell executable, one of the mongo client tools bundled when downloading MongoDB.
No additional configuration is needed for Windows, macOS, or Linux installations. The mongo shell executable is bundled with Studio 3T on these systems.
If you want to use another version of MongoDB, here’s how you can point IntelliShell to use a different mongo.exe file.
If you choose to use your own installation of the mongo shell, you can configure this in Studio 3T.
Once the mongo client tools are installed:
- Go to Studio 3T > Preferences.
- Click on the IntelliShell tab.
- Insert the path of where the mongo shell executable is located.
- Click OK.
Choose a target server, database, or collection in the Connection Tree, then open IntelliShell through three ways:
- Button – Click on the IntelliShell button in the global toolbar
- Right-click – Right-click and choose Open IntelliShell
- Shortcut – Press Ctrl + L (⌘+ L)
When you open IntelliShell on an existing collection, IntelliShell will open with the default query for that collection. You can use Studio 3T’s Query Manager to set a default query.
IntelliShell has two main sections: the top Editor section where you can write queries, commands, and scripts, and the bottom Result tab section where you can view the shell output.
You can trigger query auto-completion in three ways:
- Button – Click on the database icon, next to Enable Query Assist
- Right-click – Right-click anywhere in the Editor and choose Open Auto-Completion
- Shortcut – Press Ctrl + Space (^ + Space)
IntelliShell highlights syntax errors as you type.
These errors are also noted in the left-hand sidebar as red crosses that you can hover over, and in the right-hand script overview ruler as clickable red markers that take you straight to the error line.
You can execute queries and scripts entirely, at cursor, or just a selection.
To run an entire script:
- Button – Click on the Run (play) button in the toolbar
- Right-click – Right-click anywhere in the Editor and choose Execute Entire Script
- Shortcut – Press F5
To run a script at cursor, place the cursor at any top-level statement and:
- Button – Click on the second Run (play) button in the toolbar
- Right-click – Right-click anywhere in the Editor and choose Execute Statement at Cursor
- Shortcut – Press F6
To run a selection, highlight the part of the query or script to be executed and:
- Button – Click on the third Run (play) button
- Right-click – Right-click anywhere on the selection and choose Execute Selection
- Shortcut – Press F9
In the Result tab section, you’ll always find the Raw Shell Output tab which displays the output of all shell-run commands.
Should you choose to disable Query Assist in the toolbar, you enable what was previously the Raw Shell Mode in older IntelliShell versions. Results will appear as text output in the mongo shell.
Whenever possible, Studio 3T will parse documents from the Raw Shell Output and display them in a “prettier” Shell Output Documents tab. You can view results through the three standard views (Table, Tree, and JSON), but they will not be editable.
You can run find and aggregation queries, this way but they will no longer open editable result tabs.
Instead, they will appear along with other shell commands and scripts in the Raw Shell Output tab as you would expect in a real terminal or shell, which means you won’t be able to edit or page through the results. Query Code and Visual Explain will not be available.
Query Assist is enabled by default for standalone, top-level find and aggregation queries. This means they will be run through Studio 3T instead of the mongo shell.
Query Assist adds functionalities that are not available for shell-run queries, like the ability to:
1. Run find and aggregation queries that open their own powerful result tabs. Find queries run using Query Assist allow in-place editing.
Assisted queries are clearly labeled in the left-hand sidebar as wand icons, and in the right-hand script overview rulers as clickable yellow markers that take you straight to the query.
Each assisted query will open a separate, editable result tab, whose name will display its corresponding line in the Editor.
Click on the Query Code button on any result tab.
A Query Code tab will open. Choose your target language from the dropdown menu.
4. Use Visual Explain to help optimize performance by seeing how MongoDB executed your query.
Click on the Explain Query button on any result tab. This will open a new Explain tab that shows which steps MongoDB took to run the query.
Query Assist only assists find and aggregation queries – all other scripts and commands will always be run in the shell. Their results are viewable in the the Raw Shell Output tab.
We’ve done away with the Retain option in the old IntelliShell, which as users have told us, led to undistinguishable tabs and general tab clutter.
Now you can keep things tidy and choose to keep only the query results you need, by clicking on the Pin result button in any result tab.
All other unpinned result tabs will be cleared with the next execution, be it the entire script or a portion of it.
There are shortcuts in the IntelliShell toolbar to quickly format and indent code:
To format code:
- Button – Click on the Format icon, next to Enable Query Assist
- Right-click – Right-click anywhere in the Editor and choose Format
- Shortcut – Press Ctrl + Alt + L (or ⌥ + ⌘ + L on Mac)
To indent code:
- Button – Place a cursor in the target query/query selection and click on the Indent icon
- Shortcut – Press Tab
To unindent code:
- Button – Place a cursor in the target query/query selection and click on the Unindent icon
- Shortcut – Press Shift + Tab
You can define your Editor tab width preferences under Studio 3T > Preferences > General. The default editor tab width setting is 4 spaces.
It is also possible to comment and uncomment with a line comment.
Place the cursor on the line to be made into a comment and:
- Right-click – Right-click anywhere in the Editor and choose Comment with Line Comment. Repeat to remove the comment.
- Shortcut – Press Ctrl + / (⌘+ /). Repeat to remove the comment.
- Button – Click on the Save icon. Alternatively, click on the arrow to find the Save As function.
- Right-click – Right-click anywhere in the Editor and choose Save Script (As)
- Shortcuts – Save Script – Ctrl + S (⌘+ S), Save Script As – Shift + Ctrl + S (Shift + ⌘+ S)
To open saved queries:
- Button – Click on the Open icon
- Right-click – Right-click anywhere in the Editor and choose Open Script
- Shortcut – Press Ctrl + O (⌘+ O)
Tired of manually typing everything? You can use Visual Query Builder – our drag-and-drop MongoDB query builder – alongside IntelliShell.
Simply click on Show Visual Query Builder in the toolbar.
We’ve tightened this integration so that edits made in IntelliShell are reflected in Visual Query Builder in real-time, and vice versa. This way, you can skip the command line writing and build queries visually – or combine both ways to work even faster.