A powerful, open-source GUI for DocumentDB and MongoDB API databases.
DocumentDB for VS Code is a VS Code extension for browsing, querying, and managing databases that use the MongoDB API wire protocol. DocumentDB is fully compatible with the MongoDB API, so this extension works with any MongoDB API database: DocumentDB, Azure DocumentDB, AWS DocumentDB, Azure Cosmos DB for MongoDB (RU), MongoDB Atlas, self-hosted instances, and local emulators.
Connect with a connection string, browse through cloud service discovery, or use a local emulator. Everything runs inside VS Code with no external tools required.
Three integrated query surfaces let you work with your data however you prefer: visually, in scripts, or at a command line. All three share the same schema awareness and are linked with navigation actions, so you can move your work between them seamlessly.
The visual query interface with filter, project, and sort editors. As you type, the editor suggests field names from your collection's actual data, operators sorted by relevance to each field's type, and values appropriate for the context. Hover over any operator to see its documentation.
- Schema-aware field suggestions with BSON type indicators
- Type-aware operator ordering (comparison operators first for numbers, regex for strings)
- Relaxed query syntax: unquoted keys, single quotes, BSON constructors (
ObjectId(),ISODate()), JavaScript expressions - Real-time validation with typo detection ("Did you mean
ObjectId?") - Dedicated completions for project (
1/0) and sort (1/-1) values
Write and run JavaScript scripts in .documentdb.js files with CodeLens-driven execution. Each script block has its own Run button, and there's a Run All at the top. Results appear in a dedicated side panel.
- Full JavaScript syntax with autocompletion for
db.*chains, collection methods, and schema fields console.log(),print(), andprintjson()support- Per-file connections: multiple playgrounds open simultaneously, each connected to a different server
- CodeLens links to open the same query in the Collection View or Interactive Shell
A REPL terminal inside VS Code with shell commands (show dbs, use <db>, help, it), persistent variables, syntax highlighting, and tab completion with ghost text suggestions.
- Context-aware tab completion for databases, collections, methods, operators, and field names
- Ghost text suggests closing brackets, collection methods, and field names from your schema
Ctrl+Ccancellation for long-running operations- Clickable links in results to open the collection in Collection View or Query Playground
The Query Playground and Interactive Shell require no external tools. The query runtime is bundled directly into the extension and reuses the connection you already established. This means:
- No shell executable to install, no PATH configuration, no version mismatches
- Works with Entra ID authentication out of the box
- Works identically on Windows, macOS, and Linux
Schema information for autocompletion is gathered locally from documents you browse and query. No data is sent to external services.
Connect to any database that speaks the MongoDB API wire protocol.
- Connection strings: Paste a connection string and connect instantly
- Azure Service Discovery: Browse and connect to Azure DocumentDB, Azure Cosmos DB for MongoDB (RU), and DocumentDB on Azure VMs directly from the sidebar
- Entra ID authentication: Multi-account, multi-tenant support for Azure-hosted databases
- Folder organization: Group your connections into folders and subfolders
Set up a local DocumentDB instance from the Connections view. The extension pulls the official image, creates a persistent Docker volume, waits until the database accepts connections, and saves the connection for you.
- Guided setup with generated credentials, an available port, and optional sample data
- Docker readiness diagnostics that explain what to fix for local, WSL, SSH, dev container, and Codespaces environments
- Start, stop, restart, and delete the instance from the tree, with state kept in sync with Docker
- Works with Docker Engine or Docker Desktop; the extension never installs Docker or elevates privileges
You can also connect to the Azure Cosmos DB Emulator and other local MongoDB API instances. See Set up DocumentDB Local for details.
Browse your Atlas organizations, projects, and clusters from the sidebar, then save any cluster as a regular connection without copying endpoints by hand.
- Sign in with an Atlas API Key or Service Account, verified before it is stored
- Add a credential per organization and browse them all in one combined view
- Switch between a hierarchical tree and a flat cluster list
- Paused, creating, and updating clusters are labeled instead of failing with a connection timeout
- Open in MongoDB Atlas deep-links any discovered cluster to its Atlas page
Atlas discovery credentials are used only to find resources. Database access still uses your Atlas database username and password.
See MongoDB Atlas Service Discovery for the full guide.
Find DocumentDB clusters running in any Kubernetes environment, from AKS, EKS, and GKE to kind, minikube, and Docker Desktop, without writing connection strings or running kubectl port-forward by hand.
- Register several kubeconfig sources side by side: the default file, a file from disk, or pasted YAML
- DocumentDB Kubernetes Operator managed clusters are recognized first, with a fallback for annotated or well-known services
- ClusterIP services are reached through a port-forward tunnel that is established and restored automatically
- Connectivity labels state plainly whether a connection string is portable or only works on this machine
- Rename opaque cloud-generated context names, and switch between list and tree layouts
See Kubernetes Service Discovery for the full guide.
- Multiple data views: Inspect collections using Table, Tree, or JSON layouts with built-in pagination
- Document management: Create, edit, and delete documents directly from VS Code
- Import and export: Import JSON files or export documents, query results, or entire collections
- Collection copy-and-paste: Copy a collection and paste it into another database or server, with conflict resolution strategies
An Indexes tab in Collection View puts index work next to the queries it affects. Review what exists, create what is missing, and remove what is not earning its keep.
- Collection-level metrics for index count, total size, and total usage
- Sortable, filterable table with server-reported size and usage per index, plus quick Hidden and Unused filters
- Create Standard, Wildcard, and Vector indexes through a guided drawer with Preview as JSON
- Hide an index to test whether your queries need it before you delete it
- Hand the generated command off to a Query Playground or the Interactive Shell instead of creating it directly
- The same actions are available from the index tree items in the sidebar
See Manage Indexes in Collection View for the full guide.
Analyze query performance with explain plans and get optimization recommendations.
- Static performance analysis with selectivity, fetch overhead, and index coverage metrics
- Three-color badge system highlighting what's working well and what needs attention
- AI-powered index recommendations (experimental, opt-in via settings)
AI-powered recommendations require the GitHub Copilot extension and an active Copilot subscription.
We believe in building in the open. All development, roadmap planning, and feature discussions happen publicly on GitHub. Your feedback, contributions, and ideas shape the future of the extension.
- Service Discovery plugins: Connect to databases hosted on any cloud provider through the extensible plugin architecture
- Data migration providers: Third-party extensions can register as migration providers for specialized data movement workflows
- Community contributions: We welcome PRs, bug reports, and feature requests
No external tools or runtimes are required. Install the extension and start working.
To contribute, see these documents:
Before we can accept your pull request, you will need to sign a Contribution License Agreement. All you need to do is to submit a pull request, then the PR will get appropriately labeled (e.g. cla-required, cla-norequired, cla-signed, cla-already-signed). If you already signed the agreement, we will continue with reviewing the PR, otherwise the system will tell you how you can sign the CLA. Once you sign the CLA, all future PRs will be labeled as cla-signed.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don't wish to send usage data to Microsoft, you can set the telemetry.telemetryLevel setting to off. Learn more in our FAQ.
DocumentDB for VS Code proactively asks for user feedback and provides feedback entry points in the UI. Feedback collection is controlled by VS Code's global telemetry setting.
To disable feedback, set telemetry.telemetryLevel to a value other than all (e.g., error or off). Feedback is only active when the level is set to all.









