Page

class faunadb.page.Page(data, before=None, after=None)

Represents a single pagination result. See paginate in the docs. You must convert to Page yourself using from_raw().

__init__(data, before=None, after=None)
after = None

Optional Ref for an instance that comes after this page.

before = None

Optional Ref for an instance that comes before this page.

data = None

List of elements returned by the query.

static from_raw(raw)

Convert a raw response dict to a Page.

map_data(func)

Return a new Page whose data has had func applied to each element.

static set_iterator(client, set_query, map_lambda=None, mapper=None, page_size=None)

Iterator that keeps getting new pages of a set.

Parameters:
  • map_lambda – If present, a lambda_expr for mapping set elements.
  • mapper – Mapping Python function used on each page element.
  • page_size – Number of instances to be fetched at a time.
Returns:

Iterator through all elements in the set.