Edit

Use IntelliSense and auto-completion in the Azure Cosmos DB query editor (preview)

What this feature does

This preview capability helps accelerate query authoring with contextual completions.

Important

This capability is currently available in preview. After installing the VS Code extension, switch to the Pre-Release Version by selecting "Switch to Pre-Release Version" in VS Code.

Screenshot showing the Switch to Pre-Release Version option in Visual Studio Code for the Azure Cosmos DB extension.

Prerequisites

  • Azure Cosmos DB extension (Pre-Release version).
  • Connected Azure Cosmos DB account and container.
  • Query editor opened on a target container.

Trigger completions

  1. Open the query editor.
  2. Start typing a query, for example:
SELECT c.
FROM c
WHERE c.
  1. Use completion suggestions to insert field names and query tokens.

Example authoring flow

SELECT c.id, c.status, c.updatedAt
FROM c
WHERE c.status = "active"
ORDER BY c.updatedAt DESC

Use completions while building projection, filter, and sort clauses.

Troubleshooting

  • If no suggestions appear, confirm you are in a query editor for a connected container.
  • If fields are missing, run a baseline query first so schema context can be refreshed.
  • If behavior is inconsistent, reload Visual Studio Code and reopen the container query editor.

Limitations

  • Suggestions can be partial for highly dynamic or sparse document structures.
  • Complex expressions can still require manual SQL authoring.