Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DbObjectFilter

Defines criteria for selecting and ordering a result set of Coaty objects. It is used by the findObjects, deleteObjects, aggregateObjects, and countObjects retrieval methods.

Hierarchy

Index

Properties

Optional conditions

A single condition or a set of conditions for filtering objects (optional). If not specified or empty, all objects are selected.

A set of filter conditions can be combined by logical AND or OR.

An object filter condition is defined as a tuple specifying the name of an object property and a filter expression. The filter expression must evaluate to true when applied to the property's value for the condition to become true.

The object property to be applied for filtering is specified either in dot notation or array notation. In dot notation, the name of the object property is specified as a string (e.g. "objectId"). It may include dots (.) to access nested properties of subobjects (e.g. "message.name"). If a single property name contains dots itself, you obviously cannot use dot notation. Instead, specify the property or nested properties as an array of strings (e.g. ["property.with.dots", "subproperty.with.dots"]).

A filter expression is a tuple consisting of a filter operator and an operator-specific number of filter operands. You should use one of the typesafe filterOp functions to specify a filter expression.

Optional fetchSize

fetchSize?: number

Maximum number of rows to be retrieved from the database on a chunking fetch operation. If a value is specified on an individual query it overrides the default adapter-specific value given in the adapter options. This property is only used if the value of shouldFetchInChunks is true. If not specified or specified as 0, all rows will be fetched.

Optional orderByProperties

orderByProperties?: [ObjectFilterProperties, "Asc" | "Desc"][]

Determines the ordering of result objects by an array of (property name - sort order) tuples. The results are ordered by the first tuple, then by the second tuple, etc.

The object property used for ordering can be specified either in dot notation or array notation. In dot notation, the name of the object property is specified as a string (e.g. "objectId"). It may include dots (.) to access nested properties of subobjects (e.g. "message.name"). If a single property name contains dots itself, you obviously cannot use dot notation. Instead, specify the property or nested properties as an array of strings (e.g. ["property.with.dots", "subproperty.with.dots"]).

Optional shouldFetchInChunks

shouldFetchInChunks?: boolean

Determines whether the whole query should be executed at once or whether to fetch the query result a chunk of rows at a time to avoid memory problems. This provides an efficient way to process large query result sets. The default value of this property is false.

Note that fetching query results in chunks is significantly slower than fetching the whole query at once when the query contains not significantly more or even less items than the size of a chunk as specified by fetchSize.

Fetching results in chunks is especially beneficial in combination with the skip and take options. This is the preferred way of paging through a large result set by retrieving only a specific subset.

Optional skip

skip?: number

If skip count is given that many objects are skipped before beginning to return result objects. Typically, this option is only useful if the orderByProperties option is also specified to ensure consistent ordering of paginated results.

Optional take

take?: number

If a take count is given, no more than that many objects will be returned (but possibly less, if the request itself yields less objects). Typically, this option is only useful if the orderByProperties option is also specified to ensure consistent ordering of paginated results.

Generated using TypeDoc