Filters

Filter expressions

Meta.filters may contain an expression used to specify which properties of items belonging to a resource can be filtered, and how.

The filters expression can be a bool or a tuple of field names.

For example, the following allows all filters:

filters = True

The following allows filtering on the "name" field:

filters = {
    "name": True
}

The following allows filtering by equals and not equals on the "name" field:

filters = ("name",)

Built-in default filters

Filters are implemented for each contributed backend individually. The following filter classes are implemented for most or all backends:

_BaseFilter

_SQLAlchemyFilter

Note

you can write an equality comparison both ways:

GET /user?where={"name": "foo"}
GET /user?where={"name": {"$eq": "foo"}}