Field Operators
$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
// Text fieldawait products.query({ filter: { name: { $eq: "wireless headphones" }, },});// Numeric fieldawait products.query({ filter: { price: { $eq: 199.99 }, },});// Boolean fieldawait products.query({ filter: { inStock: { $eq: true }, },});// Date fieldawait users.query({ filter: { createdAt: { $eq: "2024-01-15T00:00:00Z" }, },});# Text fieldproducts.query(filter={"name": {"$eq": "wireless headphones"}})# Numeric fieldproducts.query(filter={"price": {"$eq": 199.99}})# Boolean fieldproducts.query(filter={"inStock": {"$eq": True}})# Date fieldusers.query(filter={"createdAt": {"$eq": "2024-01-15T00:00:00Z"}})# Text fieldSEARCH.QUERY products '{"name": {"$eq": "wireless headphones"}}'# Numeric fieldSEARCH.QUERY products '{"price": {"$eq": 199.99}}'# Boolean fieldSEARCH.QUERY products '{"inStock": {"$eq": true}}'# Date fieldSEARCH.QUERY users '{"createdAt": {"$eq": "2024-01-15T00:00:00Z"}}'