title | description | keywords | services | author | manager | editor | documentationcenter | ms.assetid | ms.service | ms.workload | ms.tgt_pltfrm | ms.devlang | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DocumentDB Query Explorer: A SQL query editor | Microsoft Docs |
Learn about the DocumentDB Query Explorer, a SQL query editor in the Azure portal for writing SQL queries and running them against a NoSQL DocumentDB collection. |
writing sql queries, sql query editor |
documentdb |
kirillg |
jhubbard |
monicar |
ac378240-b11f-4522-ae9f-09da3a6f9c16 |
documentdb |
data-services |
na |
na |
article |
08/30/2016 |
kirillg |
This article provides an overview of the Microsoft Azure DocumentDB Query Explorer, an Azure portal tool that enables you to write, edit, and run SQL queries against a DocumentDB collection.
-
In the Azure portal, in the Jumpbar, click DocumentDB (NoSQL). If DocumentDB (NoSQL) is not visible, click More Services and then click DocumentDB (NoSQL).
-
In the resource menu, click Query Explorer.
-
In the Query Explorer blade, select the Databases and Collections to query from the drop down lists, and type the query to run.
The Databases and Collections drop-down lists are pre-populated depending on the context in which you launch Query Explorer.
A default query of
SELECT TOP 100 * FROM c
is provided. You can accept the default query or construct your own query using the SQL query language described in the SQL query cheat sheet or the SQL query and SQL syntax article.Click Run query to view the results.
-
The Results blade displays the output of the query.
By default, Query Explorer returns results in sets of 100. If your query produces more than 100 results, simply use the Next page and Previous page commands to navigate through the result set.
For successful queries, the Information pane contains metrics such as the request charge, the number of round trips the query made, the set of results currently being shown, and whether there are more results, which can then be accessed via the Next page command, as mentioned previously.
If you're using multiple queries and want to quickly switch between them, you can enter all the queries in the query text box of the Query Explorer blade, then highlight the one you want to run, and then click Run query to view the results.
You can load the contents of an existing file using the Load File command.
If a query completes with errors, Query Explorer displays a list of errors that can help with troubleshooting efforts.
The Query Explorer in the Azure portal is just one way to run SQL queries against DocumentDB. You can also run SQL queries using the REST API or the client SDKs. For more information about using these other methods, see Executing SQL queries
To learn more about the DocumentDB SQL grammar supported in Query Explorer, see the SQL query and SQL syntax article or print out the SQL query cheat sheet. You may also enjoy experimenting with the Query Playground where you can test out queries online using a sample dataset.