A desktop MongoDB client built with Python and DearPyGui. Browse databases, view and edit documents, run queries, manage indexes, analyze schemas, and import/export data — all from a native GUI. Because Mongo Compass is eating up my resources at an alarming rate.
- Quick Connect — paste a MongoDB URI and connect instantly
- Saved Connections — store, edit, and organize connections with color coding
- TLS/SSL support — configure CA files, client certificates, and hostname validation
- Connection testing — verify connectivity and latency before saving
- Recent connections — quick access from the welcome screen
- Multiple connections — switch between servers without losing state
- Sidebar tree view listing all databases and their collections
- Filter/search databases by name
- Create and drop databases directly from the UI
- Create and drop collections
- Real-time collection count display per database
- Tabbed interface — open multiple collections simultaneously, each in its own tab
- Table view — spreadsheet-style document grid with resizable, reorderable, and sortable columns
- JSON view — formatted JSON display with syntax highlighting
- Inline editing — edit documents through a JSON editor dialog
- Add documents — insert new documents with JSON validation
- Delete documents — select and bulk-delete with confirmation
- Type-aware display — color-coded values by BSON type (ObjectId, Date, String, Number, Array, etc.)
- Tooltips — hover over truncated values to see the full content and type
- Filter documents using MongoDB query syntax (
{ "field": "value" }) - Sort by any field in ascending or descending order
- Dynamic sort field detection based on document structure
- Configurable page sizes: 25, 50, 100, 250, 500 documents per page
- First / Previous / Next / Last page navigation
- Direct page number input
- Total page count and document count display
- Write and execute
findandaggregatequeries - Database and collection selectors
- Query history — automatically saved per connection with execution time and document counts
- Saved queries — bookmark frequently used queries with names and descriptions
- Execution time reporting
- Results rendered in a scrollable table
- View all indexes on a collection with key patterns and properties
- Visual badges for index types: UNIQUE, SPARSE, TTL, TEXT
- Create new indexes (single-field, compound, unique, sparse, TTL)
- Drop indexes with confirmation
- Background index builds
- Sample-based schema inference across collection documents
- Configurable sample size (10 – 10,000 documents)
- Per-field breakdown: types, occurrence percentage, sample values
- Detects mixed-type fields
- Host, version, process info, uptime
- Connection counters (current, available, total created)
- Operation counters (insert, query, update, delete, getmore, command)
- Memory usage (resident, virtual, mapped)
- Network I/O (bytes in/out, request count)
- Optional auto-refresh
- Export formats: JSON (array), JSON Lines (NDJSON), CSV
- Import formats: JSON, JSON Lines
- Optional query filter for selective export
- Document limit and pretty-print options
- Progress tracking during operations
- Dark and light themes with one-click toggle
- MongoDB-branded color palette (green accent)
- Toast notifications (success, error, warning, info)
- Status bar with connection state, active database/collection, and document count
- Full keyboard shortcut support
- Responsive layout that adapts to viewport resizing
- Loading indicators on all async operations
| Shortcut | Action |
|---|---|
| Ctrl+N | New Connection |
| Ctrl+T | New Query Tab |
| Ctrl+Enter | Execute Query |
| F1 | Keyboard Shortcuts |
| F5 | Refresh |
| F11 | Toggle Fullscreen |
| Alt+F4 | Exit |
- Python 3.10+
- A running MongoDB instance (local or remote)
# Clone the repository
git clone https://github.com/natyavidhan/mongo-explorer.git
cd mongo-explorer
# Create a virtual environment
python -m venv env
source env/bin/activate # Linux/macOS
# env\Scripts\activate # Windows
# Install dependencies
pip install dearpygui pymongo# Activate the virtual environment
source env/bin/activate
# Run the application
python main.pyOn launch you will see the welcome screen. Either:
- Enter a MongoDB URI in the Quick Connect field on the sidebar and click Go.
- Click + New Connection to configure and save a connection with TLS and other options.
Once connected, databases and collections appear in the sidebar tree. Click any collection to open it in the document viewer.
Application settings are stored in an SQLite database at:
~/.mongo-explorer/config.db
This includes saved connections (URIs are stored as-is — use filesystem permissions to protect sensitive credentials), query history, saved queries, pinned collections, and UI preferences.
source env/bin/activate
pytest tests/The test suite covers the config store, JSON helpers, data models, MongoDB client wrapper, threading utilities, and UI components (158 tests).
- Threading model — All MongoDB operations run in a background thread pool (
TaskExecutor). Results are marshalled back to the UI thread via a callback queue that is drained every frame in the render loop. This keeps the GUI responsive during slow queries or network calls. - Async-safe rendering — DearPyGui's container stack is unavailable from background threads. The app uses explicit
parent=parameters andpush_container_stack/pop_container_stackwhen building UI from async callbacks. - State management — Per-tab state (documents, pagination, filters, sort order, selections) is stored in a dictionary keyed by
database.collection. Tabs can be closed independently and their state is cleaned up automatically. - Config persistence — SQLite with a simple schema: connections, query history, saved queries, pinned collections, and a key-value preferences table.
This project is licensed under the GNU General Public License v3.0.