This article covers example mappings from Legacy Query APIs to DQL for basic CRUD operations as well as syncing data with the SDK.
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.
This is the ability to insert documents at time 0. For more information see INSERT with INITIAL DOCUMENTS.
Legacy supports upserting by default where DQL requires the policy to be explicitly set.
Available in 4.11 and later with DQL_STRICT_MODE=false.
Counters are now supported in DQL. To use them you can use the APPLY keyword
followed by the field name and then the PN_INCREMENT
keyword followed by the
value you want to increment the value by.
To decrement a counter, use a negative value.
For more information on using Counters see here.
A REGISTER
is a data type in Ditto that stores a single scalar value and uses last-write-wins merge strategy for handling conflicts
Key characteristics of REGISTER:
For more information on using types and definitions, see Registers.
There are several ways to delete data in Ditto, and you can find more detail about them here.
This article covers example mappings from Legacy Query APIs to DQL for basic CRUD operations as well as syncing data with the SDK.
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.
This is the ability to insert documents at time 0. For more information see INSERT with INITIAL DOCUMENTS.
Legacy supports upserting by default where DQL requires the policy to be explicitly set.
Available in 4.11 and later with DQL_STRICT_MODE=false.
Counters are now supported in DQL. To use them you can use the APPLY keyword
followed by the field name and then the PN_INCREMENT
keyword followed by the
value you want to increment the value by.
To decrement a counter, use a negative value.
For more information on using Counters see here.
A REGISTER
is a data type in Ditto that stores a single scalar value and uses last-write-wins merge strategy for handling conflicts
Key characteristics of REGISTER:
For more information on using types and definitions, see Registers.
There are several ways to delete data in Ditto, and you can find more detail about them here.