# $eq

The `$eq` operator performs explicit equality matching on a field.
While you can often omit `$eq` and pass values directly (e.g., `{ price: 199.99 }`),
using `$eq` explicitly makes your intent clear and is required when combining with other operators.

For **text fields**, `$eq` performs a term search for single words.
For multi-word values, it behaves like a phrase query, requiring the words to appear adjacent and in order.
For **numeric fields**, it matches the exact value.
For **boolean fields**, it matches `true` or `false`.
For **date fields**, it matches the exact timestamp.

### Compatibility

| Field Type | Supported |
|------------|-----------|
| TEXT | Yes |
| U64/I64/F64 | Yes |
| DATE | Yes |
| BOOL | Yes |
| KEYWORD | Yes |
| FACET | Yes |

### Examples

<Tabs>

<Tab title="TypeScript">
```ts
// Text field
await products.query({
  filter: {
    name: { $eq: "wireless headphones" },
  },
});

// Numeric field
await products.query({
  filter: {
    price: { $eq: 199.99 },
  },
});

// Boolean field
await products.query({
  filter: {
    inStock: { $eq: true },
  },
});

// Date field
await users.query({
  filter: {
    createdAt: { $eq: "2024-01-15T00:00:00Z" },
  },
});
```
</Tab>

<Tab title="Python">
```python
# Text field
products.query(filter={"name": {"$eq": "wireless headphones"}})

# Numeric field
products.query(filter={"price": {"$eq": 199.99}})

# Boolean field
products.query(filter={"inStock": {"$eq": True}})

# Date field
users.query(filter={"createdAt": {"$eq": "2024-01-15T00:00:00Z"}})
```
</Tab>

<Tab title="Redis CLI">
```bash
# Text field
SEARCH.QUERY products '{"name": {"$eq": "wireless headphones"}}'

# Numeric field
SEARCH.QUERY products '{"price": {"$eq": 199.99}}'

# Boolean field
SEARCH.QUERY products '{"inStock": {"$eq": true}}'

# Date field
SEARCH.QUERY users '{"createdAt": {"$eq": "2024-01-15T00:00:00Z"}}'
```
</Tab>

</Tabs>
