MongoDB Compass for VS CodeAn independent MongoDB GUI for VS Code: connections, document browsing with a query bar, CRUD, an aggregation pipeline builder with live preview, index management, schema analysis, explain plans, validation rules, import/export, server stats and query history.
Built on the official FeaturesConnections (Compass
|
| Setting | Default | Description |
|---|---|---|
mongoCompass.defaultLimit |
20 |
Page size for the documents view |
mongoCompass.maxTimeMS |
60000 |
Server-side query time limit |
mongoCompass.resultView |
list |
Default documents view mode |
mongoCompass.schemaSampleSize |
1000 |
Documents sampled for schema analysis |
mongoCompass.confirmDangerousOperations |
true |
Confirm drops/deletes |
mongoCompass.queryHistoryLimit |
200 |
Max history entries |
mongoCompass.hideSystemDatabases |
false |
Hide admin/local/config |
mongoCompass.showSystemCollections |
true |
Show system.* collections |
mongoCompass.readPreference |
primary |
Default read preference |
mongoCompass.connectionTimeoutMS |
30000 |
Server selection timeout |
mongoCompass.exportBatchSize |
1000 |
Export/import batch size |
mongoCompass.autoPreviewPipeline |
true |
Auto re-run aggregation preview |
Architecture
src/
core/ # driver-agnostic services (mirrors Compass packages)
connectionManager.ts # compass-connections
connectionStore.ts # connection-storage (SecretStorage)
dataService.ts # mongodb-data-service
bsonParser.ts # mongodb-query-parser (shell syntax)
schemaAnalyzer.ts # mongodb-schema
explainHelper.ts # explain-plan-helper
exportToLanguage.ts # bson-transpilers / export-to-language
importExport.ts # compass-import-export
queryHistory.ts # recent queries
myQueries.ts # my-queries-storage
config.ts, logger.ts, types.ts
explorer/ # TreeView (sidebar navigation)
webviews/ # webview panels
baseWebview.ts # shared panel infra (CSP, messaging)
documentsPanel.ts # compass-crud
aggregationPanel.ts # compass-aggregations
dataPanel.ts # indexes/schema/validation/explain/stats/history/…
documents/, aggregation/, dataview/ # webview front-ends
shared/ # shared CSS + client helpers
commands/ # connection form
extension.ts # activation + command registration
Packaging
npm ci
npm run package # produces mongo-compass-<version>.vsix
Install the resulting file with Extensions: Install from VSIX... before publishing it.
Security and privacy
- Connection strings are stored in VS Code
SecretStorage, backed by the operating system credential store. - Query history and saved queries are stored locally in VS Code global storage.
- The extension does not include telemetry or send database contents to an external service.
- Database queries and commands are sent only to the MongoDB deployment selected by the user.
- Review the target database before using destructive operations such as drop, delete, restore,
$outor$merge.
Support
Report defects through the repository issue tracker. Include the extension version, VS Code version, MongoDB server version and relevant output from MongoDB: Show Output Channel. Do not include credentials or unredacted connection strings.
Notes & limitations
- This is an independent implementation inspired by MongoDB Compass; it is not affiliated with MongoDB, Inc.
- Atlas Search indexes require an Atlas deployment.
- The webview editors use plain textareas with EJSON/shell syntax (no CodeMirror autocompletion as in Compass).
- Data modeling diagrams, the embedded mongosh, and the GenAI assistant from Compass are out of scope.
License
MIT