pub.techne.draft.query.countRecords

How many records a pub.techne.draft.query names: the records listRecords would answer for it (the same read path, the platform's `decide` on every record answered as written or permissioned, and a curated `location` `in`/`covers` match settled again over the locations the curated view trusts), each once, so the count is what paging the list to its end would answer. The count stops at 1000 (`capped`). The query's `order`, `limit` and `signals` are ignored, so a record without the role a list is ordered by is still counted. Anyone may call it, signed in or not; an anonymous caller counts public records only. Draft tier.

Details · query
Kindquery
Authorityquery.draft.techne.pub
Commit rev3n3iob7wb2g2u
Indexed

Query

query · GET

Parameters

query string

groupBy

string

Count per type or per author instead of in all.

  • knownValues: type | author

params

string

The query's parameters as a JSON object of strings (or lists of strings), e.g. {"here": "40.01,-105.27"}. `$viewer` and `$now` are the platform's and cannot be passed.

  • maxLength: 8192

query

string

A pub.techne.draft.query object, as JSON. Give this or `queryUri`.

  • maxLength: 16384

queryUri

string · at-uri

A published pub.techne.draft.query record to run. Give this or `query`.

Output

application/json

capped

requiredboolean

True when the count stopped at 1000.

count

requiredinteger

Records counted (at most 1000).

groups

array

With groupBy: the count per key, largest first.

itemsref
Reference

Present when a `near` or `covers` point or an `in` area of the query lies outside this operator's coverage, or an `in` area is not held here. The records answered are what this operator holds, not the whole answer: an empty list (or a zero count) with this set means "not served here", not "nothing there". Ask an operator that serves the place.

Errors

InvalidRequest

HTTP 400. A malformed or refused query or parameter.

ViewRequired

HTTP 400. A branch of the query names no `view` (curated or asWritten): there is no default. The message names the branch.

NotCurated

HTTP 400. A branch read with view `curated` names a type (`type is`/`type in`) no curator the commons root trusts covers; the message names the type. Read it with view `asWritten`.

NotFound

HTTP 404. `queryUri` names no query record the caller may read.

#group

object

Properties

count

requiredinteger

key

requiredstring

Similar lexicons

semantic match

Lexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.

  • The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned rec

  • A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held sh

  • Up to 12 generic reads in one call. Each step is a pub.techne.draft.query.listRecords call (a list step) or a pub.techne.draft.query.getRecords call (a get step) and answers exactly as that method would for the same caller. A step runs once the steps it binds to have answered (at most 4 at once); the answer does not depend on which finished first. A binding, a string `$<step>.<output>` in a list step's `params` or among a get step's `uris`, stands for that output over the earlier step's records,

  • Records by URI, as listRecords answers them: the query `{"view": "asWritten", "where": {"uri": {"in": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the cu