Reference · Platform methods

pub.techne.draft.query.countRecords

query · GETIn the SDK, countRecords

How many records a pub.techne.draft.query names, up to 1000.

It counts what listRecords would answer you for the same query, each record once. The query's order, limit and signals are ignored. Anyone may call it. Signed out, you count public records only.

Input query parameters

NameTypeWhat it is
querystringA pub.techne.draft.query object, as JSON, up to 16384 characters. Give this or queryUri.
queryUriat-uriA published pub.techne.draft.query record to run. Give this or query.
paramsstringThe query's parameters as a JSON object of strings (or lists of strings), up to 8192 characters. $viewer and $now are the platform's and cannot be passed.
groupBystringtype or author. It counts per type or per author instead of in all.

Output application/json

NameTypeWhat it is
countrequiredintegerRecords counted, at most 1000.
cappedrequiredbooleanTrue when the count stopped at 1000.
groupsgroup[]{ key, count } per type or author, largest first. Only with groupBy.

Errors InvalidRequest (400, a malformed or refused query or parameter) and NotFound (404, queryUri names no query record you may read). The full lexicon is at countRecords.query.draft.techne.pub.

A count with the page

That asks listRecords for count and capped. For a count alone, or by type or author, call this method.

By author

listRecords and countRecords take a reader. A reader is any function that sends a GET for an NSID and answers its JSON.

Places within 5 km, per author
What comes back