Legacy-to-DQL Reference
This article covers example mappings from Legacy Query APIs to DQL for basic CRUD operations as well as syncing data with the SDK.
Creating Documents
In DQL syntax, enclose string
literals within single quotes (''
); for example 'blue'
.
Use single quotes in DQL queries to ensure accuracy. Incorrectly using double quotes (""
); for example "blue"
, may prevent document matching. Currently, Ditto does not throw a warning for this issue.
Inserting a Single Document
Legacy
DQL
Inserting Multiple Documents
Legacy
DQL
Inserting Initial/Default Documents
This is the ability to insert documents at time 0. For more information see INSERT with INITIAL DOCUMENTS.
Legacy
DQL
Upserting Documents
Legacy supports upserting by default where DQL requires the policy to be explicitly set.
Legacy
DQL
Reading Data
Querying Data
Legacy
DQL
Querying Data by ID
Legacy
DQL
Querying Data with Limits
Legacy
DQL
Querying for Null Values
Legacy
DQL
Querying with Arguments
Legacy
DQL
Observing Data Changes
Legacy
DQL
Updating Documents
Updating a Single Document
Legacy
DQL
Updating Multiple Documents
Legacy
DQL
Updating Multiple Fields
Legacy
DQL
Deleting Documents
Evicting Documents
Legacy
DQL
Deleting Documents
There are several ways to delete data in Ditto, and you can find more detail about them here.
Removing documents with the below method creates a “tombstone” record which is replicated to indicate something was deleted. This tombstone cannot be removed later, so we recommend only doing this for documents which are no longer present on any small peers.
In the future, this will be replaced by a DELETE
command which handles system-wide deletes more cleanly.
Legacy
DQL
Syncing Data From Other Peers
Legacy
DQL
Was this page helpful?