To permanently delete a document from a collection see
DELETE.DQL
your_collection_nameis the name of the collection from which you want to retrieve the data.[ids]represents the document IDs to evict, given as a parameter or a literal list, rather than selecting documents with aWHEREpredicate (optional).[condition]represents the condition or criteria that determine which documents should be evicted from the local peer.[limit]represents the maximum number of documents that should be evicted[offset]represents the offset from 0 that should be used for the eviction query, in practice this should be rarely used[order by]represents the path within a document to use to order the dataset and order (ASCorDESC)[projection]returns fields or expressions taken from the evicted documents (optional). See RETURNING.
Examples of Evicting Documents
Here, documents from thecars collection that have the document ID 123 get removed from the Ditto store:
DQL
DQL
Evicting Documents by ID
The optionalUSE IDS clause names the documents to evict by ID, instead of selecting them with a WHERE predicate. The IDs may be supplied as a literal list or as a query parameter:
DQL
EVICT with RETURNING
Add aRETURNING clause to get back the evicted documents, as they were immediately before removal, rather than just the IDs of the documents that were evicted:
DQL
Removing Data from Ditto Server
Removing data from a distributed database is a difficult problem, and memory management requires careful consideration of both subscriptions and evictions. Note that any data evicted from Ditto Server will reappear if it exists on any device running the Ditto SDK connected to Ditto Server. To permanently remove the data, you must first ensure the data is no longer subscribed to, and is already evicted, by any connected devices running the Ditto SDK. For specifics on evicting and deleting documents in all Ditto SDKs and to learn more about our recommended strategies, seeSDK>CRUD>Removing Documents.
Alternatively, data can be tombstoned from Ditto Server using the legacy API. See: Writing: HTTP (Legacy).