Skip to content

Operators are used within .where() clauses to filter your data. Mizzle intelligently maps these to DynamoDB’s KeyConditionExpression (for efficient indexed queries) or FilterExpression.

FunctionDynamoDB OperatorDescription
eq(col, val)=Equal to.
gt(col, val)>Greater than.
gte(col, val)>=Greater than or equal to.
lt(col, val)<Less than.
lte(col, val)<=Less than or equal to.
between(col, [v1, v2])BETWEENBetween two values (inclusive).
inList(col, [v1, v2, ...])INValue is in a list.
FunctionDynamoDB FunctionDescription
beginsWith(col, string)begins_withString starts with prefix.
contains(col, val)containsCollection contains value or string contains substring.
attributeExists(col)attribute_existsChecks if attribute exists on the item.
FunctionDynamoDB OperatorDescription
and(...expr)ANDCombines multiple expressions with AND.
or(...expr)ORCombines multiple expressions with OR.
import { eq, and, gt } from "@aurios/mizzle";
db.select()
.from(users)
.where(
and(
eq(users.status, "active"),
gt(users.age, 18)
)
)