type

Filter

@Js
abstract const class Filter : Obj

Filter models a declarative predicate for selecting dicts. See Filters for details.

constructors

fromStr

Parse a query from string - see Filters for format.

methods

equals

Equality is based on the normalized string.

hash

Hash is based on toStr.

include

Deprecated - use matches

matches

Return if the specified record matches this filter.

toStr

Return the normalized string of the filter

Slot Details

equals

virtual override Bool equals(Obj? that)

Equality is based on the normalized string.

fromStr

static new fromStr(Str s, Bool checked := true)

Parse a query from string - see Filters for format. If the query cannot be parsed then return null or throw ParseErr with location of error.

hash

virtual override Int hash()

Hash is based on toStr.

include

@Deprecated { msg="Use matches" }
Bool include(Dict r, |Ref->Dict?|? pather)

Deprecated - use matches

matches

Bool matches(Dict r, HaystackContext? cx := null)

Return if the specified record matches this filter. Pass a context object to enable def aware features and to path through refs via the -> operator.

toStr

abstract override Str toStr()

Return the normalized string of the filter