---
title: "Studio: Query View"
description: "Use the Query View* to run RQL queries and view their results."
url: "https://docs.ravendb.net/6.2/studio/database/queries/query-view"
version: "6.2"
---

# Studio: Query View

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Studio: Query View

> **Note**
>
> - Use the **Query View** to run [RQL](https://docs.ravendb.net/6.2/client-api/session/querying/what-is-rql.md) queries and view their results.
>
> - Queries can be executed either on a **Collection** or on an existing **Static-Index**.
>
> - RavenDB always uses an index to fetch the query results.  
>   When a query is executed over a Collection (without any filtering condition),  
>   RavenDB uses an internal index that is kept in its internal storage.
>
> - A query on a collection with some filtering condition will create an **Auto-Index** (Dynamic Query).  
>   See [Index Types](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-overview.md#index-types) for details.
>
> - Query results can be saved/exported to a CSV file.
>
> - In this page:
>   - [Query View](#query-view)
>   - [Query Results](#query-results)
>     - [Select Visible Columns](#select-visible-columns)
>     - [Result Columns](#result-columns)
>   - [Additional Query Options](#additional-query-options)

## Query View

![Query View](https://docs.ravendb.net/assets/images/query-view-822c545da184c066378a7c95b85260b4.png)

1. **Query View**  
   Click to open the query view.
2. **Database**  
   Click to select the database you want to query.
3. **Syntax Samples**  
   Click to display [RQL](https://docs.ravendb.net/6.2/client-api/session/querying/what-is-rql.md) syntax samples.
4. **Query Box**  
   Enter your RQL query in the query box.
5. **Save Query**  
   Click to save the currently displayed query in the local browser storage.  
   ![Save Query](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-save-query.png)  
   Enter a name, and click the **Save** button again to save the query.
6. **Load Query**  
   Click to load a stored query.  
   Recent (unsaved) queries will also be listed here.  
   ![Load Query](https://docs.ravendb.net/assets/images/query-view-load-query-d9b4a3d9e5f6cf0793d019157a1367de.png)  
   Hover over a query name to display its preview.  
   Click the query name or the preview **Load** button to load the query.
7. &#x20;**Query Settings**  
   Click to set query settings.  
   ![Query Settings](https://docs.ravendb.net/assets/images/query-view-settings-6a74ec8e6498b09df8e02db1c2807394.png)
   - a. **Cache enabled**  
     Toggle to enable or disable caching of query results.
   - b. **Disable creating new Auto-Indexes**  
     Toggle to disable Auto-Index creation for this query.
     If no index exists to satisfy this query, an exception will be thrown.
     - Toggling this ON will not affect Auto-Index creation in future Studio queries.
       To disable all future Auto-Index creation from Studio queries, change the default setting in [Studio Configuration](https://docs.ravendb.net/6.2/studio/database/settings/studio-configuration.md#disabling-auto-index-creation-on-studio-queries-or-patches)
   - c. **Show stored index fields only**  
     Toggle to show the query results or only the stored index fields.  
     (Relevant only when querying an index)
   - d. **Show raw index entries instead of index results**  
     Toggle to display **raw index entries** or **matching documents** in the query results.  
     (Relevant only when querying an index)
8. **Run Query**  
   Click to run the query.
9. **Query Results**  
   The results area displays selected columns of results retrieved by your query (see [below](#query-results)).

## Query Results

![Query Results](https://docs.ravendb.net/assets/images/query-view-query-results-49d64e701e51904f4ce0de02a30bb0cc.png)

1. **Index or Collection Used**  
   The index or the collection that was used by the query.
2. **Results Retrieval Time**  
   The time it took to retrieve the results.
   > **Note**
   >
   > Add `include timings()` to your RQL to display additional timing details in the results.  
   > Learn more in [Include Query Timings](https://docs.ravendb.net/6.2/client-api/session/querying/debugging/query-timings.md).
3. **Delete Documents**  
   Click to delete all documents that match the query.
4. **Statistics**  
   Click to view query statistics, including -
   - Number of results
   - Results status
   - Query duration
   - The index used by this query.  
     Either the index that was explicitly used by the query, or the internal RavenDB index that is
     used [for collection queries](https://docs.ravendb.net/6.2/client-api/faq/what-is-a-collection.md#collection-usages).
   - An ETag representing the current state of the index used by the query.  
     (The ETag value changes with every change made to the documents)
5. **Export Results as CSV File**
   - Click to store **all query results columns** in a CSV file.  
     ![Export to CSV File](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-export-to-csv-file.png)
   - Click the drop-down and select "Export visible columns only"
     to store **only the columns that are currently displayed**.  
     ![Export Visible Columns Only](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-export-visible-columns-only.png)
6. **Display**  
   Click to open the Display drop-down dialog, where you can select which columns
   to display and add custom columns. (See **Select Visible Columns** below).
7. **Toggle Expanded/Collapsed View**  
   Click to expand or collapse the results view.

### Select Visible Columns

To modify the displayed result columns, open the Display drop-down dialog from the [Query Results](#query-results) view.  
Custom result columns can be added, edited and removed.

![Display Dialog](https://docs.ravendb.net/assets/images/query-view-display-dialog-fc1d0a468e4364649b66ed6ad3824cb9.png)

1. **A query results column**
2. **A custom results column**
   ![Display Dialog - Actions](https://docs.ravendb.net/assets/images/query-view-display-dialog-actions-b2dc4caf3a8b94beb3d9a6ca89401efa.png)

> **Info**
>
> Changes made in the Display dialog will take effect only when the **Apply** button is clicked.

1. **Display/Hide all columns**  
   Check or uncheck to display or hide all columns.
2. **Display/Hide column**  
   Check or uncheck to display or hide this column.
3. **Relocate Column**  
   Click and drag to relocate the column.
4. **Edit Custom Column**  
   Click to edit the custom column's **field** and **alias** (see **Add Custom Column** below).
5. **Remove Custom Column**  
   Click to remove the custom column.
6. **Add Custom Column**  
   ![Add Custom Column](https://docs.ravendb.net/assets/images/query-view-add-custom-column-079763040e2ef0f5cb112699d6186c09.png)
   - a. Identify a results field that will be displayed in the custom column.  
     E.g. `this.Address.Country`
   - b. Give the custom column an alias that will be displayed as the column's title.  
     E.g. `Country`
   - c. Click to add the new column and close the custom column dialog.
   - d. Click to close the custom column dialog without adding the new column.
7. **Reset to default**  
   Reset result columns to their original state (determined by the query).
8. **Close**  
   Close the Display dialog without applying your changes.
9. **Apply**  
   Apply your changes and close the Display dialog.

### Result Columns

![Result Columns](https://docs.ravendb.net/assets/images/query-view-result-columns-988b7d77d997930c60d76c640e9c057d.png)

1. **Preview**  
   Click for a preview of the retrieved item.
2. **Document ID**  
   Click the ID to open this document in the [Document View](https://docs.ravendb.net/6.2/studio/database/documents/document-view.md),  
   -or-  
   Hover over the ID to display it in text format and optionally copy it to the clipboard.  
   ![Hover ID](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-ID-column.png)
3. **Multiple Records Result**  
   Hover over the brackets to display the retrieved records and optionally copy them to the clipboard.  
   ![Multiple Records Result](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-multiple-records-result.png)
4. **Text Result**  
   Hover over the text to display and optionally copy it to the clipboard.  
   ![Text String Result](https://raw.githubusercontent.com/ravendb/docs/main/versioned_docs/version-6.2/studio/database/queries/assets/query-view-text-string-result.png)

## Additional Query Options

Some RavenDB features enhance the queries options.

- [Time Series Query](https://docs.ravendb.net/6.2/document-extensions/timeseries/overview.md) results provide insight
  into your time-series data, including a graph view over time.  
  Learn more about it [here](https://docs.ravendb.net/6.2/studio/database/document-extensions/time-series.md#querying-time-series).
- [Spatial Query](https://docs.ravendb.net/6.2/studio/database/queries/spatial-queries-map-view.md) results include
  a Spatial Map Tab that [displays geographical locations](https://docs.ravendb.net/6.2/studio/database/queries/spatial-queries-map-view.md#spatial-map-view)
  on the world map.
- [Counter Query](https://docs.ravendb.net/6.2/document-extensions/counters/counters-and-other-features.md#counters-and-queries) can be used to get counters data.
