Skip to main content
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 TypeSupported
TEXTYes
U64/I64/F64Yes
DATEYes
BOOLYes

Examples

// 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" },
  },
});