Skip to content

InvalidPredicateError

Defined in: src/query/errors.ts:55

A predicate or query could not be expressed in the query language for a reason other than its operator. The main causes:

  • a $ name that is not a queryable system attribute — one returned in results but never indexed ($createdAt, $updatedAt, $creationFlags), or none at all;
  • a system attribute compared against the wrong type, or tested with exists() / hasType(), which on a system attribute would be constants;
  • a comparison against a bytes value, which is never indexed;
  • a BETWEEN whose bounds have different types;
  • a hasType() tag that is not an indexable type;
  • a combinator with nothing to combine;
  • a query with no filter at all — a named schema’s tag counts as one;
  • through .from(schema), a filter that does not fit the schema: a name that is not a column, a column that is not indexed, or a value of another type than the column’s;
  • a sort key that cannot be sent: an orderBy() with no key or more than one, a key on a bytes column or on something that is not a column of the schema, one with no type and no schema to take it from, or one whose type is not the attribute’s.
  • Error

new InvalidPredicateError(message, attributeName?): InvalidPredicateError

Defined in: src/query/errors.ts:59

string

string

InvalidPredicateError

Error.constructor

readonly attributeName: string | undefined

Defined in: src/query/errors.ts:57

The attribute the predicate names, where there is one.