Use DocumentDB for VS Code to connect to a local DocumentDB instance, browse sample data, and create your first database without leaving the editor.
Install the extension from the VS Code marketplace, or run:
code --install-extension ms-azuretools.vscode-documentdbIf VS Code prompts you to reload after installation, do that before creating a connection.
For the fastest local setup, start DocumentDB Local with Docker:
docker run -dt --name documentdb \
-p 10260:10260 \
ghcr.io/documentdb/documentdb/documentdb-local:latest \
--username <YOUR_USERNAME> \
--password <YOUR_PASSWORD>If you prefer a host installation instead of Docker, use Linux Packages Quick Start and complete the documentdb-setup step first.
10260, your username, and your password.Once connected:
sampledb if you started with DocumentDB Local sample data.users or products.{
"name": "VS Code Quick Start",
"source": "vscode",
"status": "connected"
}If you prefer to validate outside the extension first, use Mongo Shell Quick Start.
After the connection works, the extension can help you continue without leaving VS Code:
If the extension does not connect on the first try:
docker ps and docker logs documentdbsudo systemctl status documentdb-gateway and sudo journalctl -u documentdb-gateway --no-pager -n 50mongosh to confirm the endpoint works independently of VS CodeFor extension-specific help or bugs: