Interface Overview
The top of the interface shows the total number of scripts and provides quick access to key actions:
- Script Count - Displays total number of saved scripts matching current filters
- Sort Toggle - Switch between sorting by name (alphabetical) or date (most recent first)
- Export Button - Export all scripts to JSON file for backup or sharing
- Import Button - Import scripts from JSON file
- Refresh Button - Reload the script list from the server
Search Bar
Filter scripts by typing in the search box. Search looks across:
- Script name
- Script description
- Connection name
- Database name
Script Tree
Scripts are organized in a hierarchical tree structure:
- Connections - Top level shows each MongoDB connection (green plug icon)
- Databases - Each connection contains databases (blue database icon)
- Folders - Within databases, organize scripts in custom folders (yellow folder icon)
- Scripts - Individual scripts appear as purple file icons with their name and last modified time
Browsing Scripts
Navigating the Tree
Click on any folder, database, or connection to expand or collapse it:
- Expand - Click to reveal contents beneath
- Collapse - Click again to hide contents
- Chevron Icon - Points right when collapsed, rotates down when expanded
- Item Count - Shows total number of scripts and subfolders in each container
Sorting Options
Use the sort toggle in the header to control script order:
| Sort Mode |
Description |
| Name |
Scripts sorted alphabetically by name |
| Date |
Scripts sorted by last modified date, most recent first |
Each script displays:
- Script Name - The name you gave when saving
- Description - Optional description appears next to the name
- Last Modified - Shows relative time (e.g., "5m ago", "2h ago", "3d ago")
Running Scripts
Loading into Shell
There are multiple ways to load a script into MongoDB Shell:
- Double-click - Opens the script in a new MongoDB Shell activity tab
- Run Button - Hover over a script and click the green play button
- Context Menu - Right-click and select "Run"
What Happens When Loading
When you run a script:
- A new MongoDB Shell activity tab opens
- The script content loads into the code editor
- Connection and database are automatically set to match the saved script
- The script is linked to the saved version for easy updates
- You can execute the script immediately or make changes first
Organizing with Folders
Creating Folders
Keep your scripts organized by creating custom folders:
- Hover Over Database or Folder - A folder-plus icon appears on the right
- Click Folder-Plus Icon - Opens the create folder dialog
- Right-click Menu - Select "Create Subfolder" from the context menu
- Enter Folder Name - Type a name and click Create
Folder Rules
- Folders must be created inside a database or another folder
- Folders can be nested multiple levels deep
- Empty folders are preserved even when they contain no scripts
- Folder names are always sorted alphabetically
Moving Scripts Between Folders
Use drag and drop to reorganize your scripts:
- Click and Drag - Click on a script and drag it to a database or folder
- Drop Zone Highlight - Valid drop locations highlight as you drag
- Multiple Selection - Select multiple scripts and drag them together
- Same Connection Only - Scripts can only move within the same connection and database
Deleting Folders
Remove folders you no longer need:
- Right-click on a folder and select "Delete Folder"
- Confirm the deletion in the dialog
- All scripts inside the folder are permanently deleted
- Empty folders are deleted immediately without confirmation
Managing Scripts
Script Actions
Hover over any script to reveal action buttons:
- Run - Load the script into MongoDB Shell and open it in a new tab. The connection and database are automatically set.
- Clone - Create a duplicate copy of the script with " (copy)" appended to the name. The clone appears in the same folder.
- Delete - Permanently remove the script. You'll be asked to confirm before deletion. This action cannot be undone.
Multi-Select Operations
Select multiple scripts for batch operations:
- Click + Ctrl - Hold Ctrl (or Cmd on Mac) and click scripts to select multiple
- Shift Click - Click one script, hold Shift, and click another to select all scripts in between
- Visual Feedback - Selected scripts are highlighted with a blue background
- Batch Delete - Right-click on any selected script and choose Delete to remove all selected
- Batch Move - Drag any selected script to move all selected scripts together
Right-click on different elements to access context-specific actions:
- Run - Load the script into MongoDB Shell
- Clone - Create a duplicate copy
- Delete - Remove the script (shows count if multiple selected)
- Create Subfolder - Add a new folder inside this one
- Expand/Collapse - Toggle visibility of contents
- Delete Folder - Remove folder and all scripts inside
- Create Subfolder - Add a new folder at the database level
- Expand/Collapse - Toggle visibility of contents
Import and Export
Exporting Scripts
Create a backup or share your script library:
- Click the Export button (download icon) in the header
- All scripts are saved to a JSON file
- File includes script content, names, descriptions, connections, and databases
- Filename includes timestamp (e.g., saved_scripts_1704123456789.json)
Importing Scripts
Load scripts from a previously exported file:
- Click the Import button (upload icon) in the header
- Select a JSON file from your computer
- Scripts are imported as new entries (not merged with existing)
- Success message shows how many scripts were imported
- If import fails, you'll see an error message with details
The import feature accepts two JSON formats:
- Full Export Format - Files created by the Export button with version and timestamp metadata
- Script Array Format - Plain array of script objects for custom integrations
Keyboard Navigation
Navigate the script library efficiently using keyboard shortcuts:
| Shortcut |
Action |
| Arrow Down |
Move to next script or folder |
| Arrow Up |
Move to previous script or folder |
| Arrow Right |
Expand folder or database |
| Arrow Left |
Collapse folder or database, or jump to parent |
| Enter |
Run selected script or toggle folder expand/collapse |
| Page Down |
Jump down 10 items |
| Page Up |
Jump up 10 items |
Note: Keyboard shortcuts only work when the search box and folder name input are not focused