Overview
Lua Query is the single filter language for every Lua platform API that exposes afilter parameter. It behaves the same for Data, Products, and any other Mongo-backed entity: the entity changes, but the supported syntax, validation rules, limits, and errors do not.
API implementations scope the compiled query to the entity’s data and immutable ownership fields. Filter input cannot replace an agent, collection, user, or organization predicate.
Methods without a
filter parameter do not interpret their input as Lua Query. For example, User.get() selects one record by an exact user and agent identity; custom properties stored on that record remain ordinary data.Supported syntax
Comparison operands must be JSON scalars. Membership operands must be arrays of JSON scalars. Logical operators are allowed only at the root of a filter or one of its logical branches.$eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, root $and, and root $or.
Security and errors
Lua Query is deliberately smaller than the complete MongoDB query language. Unknown or dangerous operators—including$where, $expr, $function, $regex, $text, and geospatial operators—are rejected with a 400 error and a stable FILTER_* code. They are never executed, silently removed, or allowed to widen the query.
Field paths cannot contain $ segments, null bytes, empty segments, or prototype-related names. Invalid operands and misplaced operators also fail closed.
Resource limits
The same limits apply on every API surface:
These limits protect shared database capacity while keeping common application queries expressive and predictable.

