# filter

> **Attribute** in `langgraph.store`

📖 [View in docs](https://reference.langchain.com/python/langgraph.store/base/SearchOp/filter)

Key-value pairs for filtering results based on exact matches or comparison operators.

The filter supports both exact matches and operator-based comparisons.

## Signature

```python
filter: dict[str, Any] | None = None
```

## Description

**Supported Operators:**

- `$eq`: Equal to (same as direct value comparison)
- `$ne`: Not equal to
- `$gt`: Greater than
- `$gte`: Greater than or equal to
- `$lt`: Less than
- `$lte`: Less than or equal to

???+ example "Examples"

Simple exact match:

```python
{"status": "active"}
```

Comparison operators:

```python
{"score": {"$gt": 4.99}}  # Score greater than 4.99
```

Multiple conditions:

```python
{
    "score": {"$gte": 3.0},
    "color": "red"
}
```

---

[View source on GitHub](https://github.com/langchain-ai/langgraph/blob/08a2016953789a4f579b4d36bd1967941ec62012/libs/checkpoint/langgraph/store/base/__init__.py#L250)