---
title: EVICT
slug: dql/evict
docTags: 
createdAt: 2023-11-02T21:43:20.895Z
---

The `EVICT` operation removes one or more documents from the local Ditto store, deleting them entirely without flagging (`tombstone`) as deleted to remote peers:

:::CodeblockTabs
DQL

```sql
EVICT FROM your_collection_name
WHERE [condition]
```
:::

In this syntax:

- `your_collection_name` is the name of the collection from which you want to retrieve the data.
- `[condition]` represents the condition or criteria that determine which documents should be evicted from the local peer.

# Examples Deleting Documents

Here, documents from the `cars` collection that have the document ID `123` get removed from the Ditto store:

:::CodeblockTabs
DQL

```sql
EVICT FROM cars
WHERE _id = '123'
```
:::

As another example, the following snippet, once executed, results in the deletion of documents with timestamps greater than a certain value:

:::CodeblockTabs
DQL

```sql
EVICT FROM cars
WHERE some_time_stamp > 1699888298000
```
:::

# Removing Fields from Documents

To remove a specific field from a document, use an <font color="#db2777">`UPDATE`</font> statement to *tombstone* that field. A tombstone is a flag signaling to remote peers that the DQL data type has been removed. See: [UPDATE](docId:92_yx2EvbKxxSWNL09oYP)

# Removing Data from Big Peer

`EVICT` is not currently available for the Big Peer, although it's in development. To learn more about removing data from your Big Peer instance, see [Writing: HTTP (Legacy)](docId\:JMhbyt6ShuVF5rk8QgUMv) .

# Developing an Eviction Strategy

Removing data from a distributed database is a difficult problem, and memory management requires careful consideration of both subscriptions and evictions.

To learn more about our recommended strategies, see [DELETE](docId:2iXFV6yFQiKjroBx0cUjd).
