# Comparison

> **Class** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/structured_query/Comparison)

Comparison to a value.

## Signature

```python
Comparison(
    self,
    comparator: Comparator,
    attribute: str,
    value: Any,
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `comparator` | `Comparator` | Yes | The comparator to use. |
| `attribute` | `str` | Yes | The attribute to compare. |
| `value` | `Any` | Yes | The value to compare to. |

## Extends

- `FilterDirective`

## Constructors

```python
__init__(
    self,
    comparator: Comparator,
    attribute: str,
    value: Any,
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `comparator` | `Comparator` |
| `attribute` | `str` |
| `value` | `Any` |


## Properties

- `comparator`
- `attribute`
- `value`

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/core/langchain_core/structured_query.py#L126)