The Ditto DQL Editor is a powerful interface for working directly with your app’s data stored in the Ditto Portal. It allows you to write and run DQL queries to read, insert, update, and delete documents across your collections. The editor also includes helpful features like query history/favorites that persist across sessions and data import/export tools to streamline your workflow.
Item | Description |
---|---|
1 | Navigation Breadcrumb bar - can use to navigate back to the Collections page or to your app’s home page |
2 | Navigation Tabs to switch between the DQL Editor and the Collections Data Browser |
3 | Links to the documentation, import one or more documents as JSON or CSV files, and settings for the DQL Editor. The settings are used to enable or disable Strict Mode |
4 | Collections - list of collections in the app |
5 | DQL Editor - write DQL queries to read, insert, update, and delete documents. |
6 | Run query - execute the query in the DQL Editor. |
7 | View favorite queries and query history. |
8 | Switch between table and tree view. |
9 | Export query results that are displayed in the query results pane. |
10 | Query results pane that shows the results of the query in JSON or table format. |
Click to upload or drag and drop
link to select a file to import._id
will be displayed in the query results pane as Mutated document ID
.
_id
will be displayed in the query results pane as Mutated document ID
.
Strict Mode
. With strict mode enabled, all fields are treated as a register by default. When enabled, every field in a document must match the collection definition exactly — including its CRDT type (e.g., map, register, counter).
Disabling strict mode enables new functionality: when turned off, collection definitions are no longer required. SELECT queries will return and display all fields by default. This matches the behavior of the legacy query language. - objects in INSERT and UPDATE statements are treated as maps. When a field has multiple possible types, the most recently updated type is chosen.
For new projects, we recommend disabling strict mode. You can learn more about this feature here.
drawer
icon in the top right corner of the pane.
locations
collection is shown below:
single quotes
for field names and string values. Use double quotes in DQL query editor will result in an error: Invalid query: DQL parser error: Unexpected token { at line 2 column 8 near "VALUES {"; expected (
deserialize_json
function to convert the JSON string to a DQL string. An example of this is shown below:
Mutated document ID
.Table
button in the top right corner of the query results pane.
...
button. You can close the Queries pane by clicking the ‘x’ button in the top right corner of the pane.
Export query result
button in the top right corner of the query results pane. You can export the results as a JSON file or a CSV file.
Item | Description |
---|---|
1 | Navigation Breadcrumb bar - can use to navigate back to the Collections page or to your app’s home page |
2 | Navigation Tabs to switch between the DQL Editor and the Collections Data Browser |
3 | Links to the documentation, import one or more documents as JSON or CSV files, and settings for the DQL Editor. The settings are used to enable or disable Strice Mode |
4 | Collections - list of collections in the app |
5 | Data Browser - table view of the documents in a collection |
6 | JSON Document viewer - JSON view of a document |