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
| Kind | query |
|---|---|
| Authority | query.draft.techne.pub |
| Commit rev | 3n3iob7wb2g2u |
| Indexed |
Checks
Validunlimited-stringdefs.group.properties.keyNo maxLength, maxGraphemes or format limits this string.unlimited-stringdefs.main.parameters.properties.groupByNo maxLength, maxGraphemes or format limits this string.
{
"$type": "com.atproto.lexicon.schema",
"defs": {
"group": {
"properties": {
"count": {
"type": "integer"
},
"key": {
"type": "string"
}
},
"required": [
"key",
"count"
],
"type": "object"
},
"main": {
"description": "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.",
"errors": [
{
"description": "HTTP 400. A malformed or refused query or parameter.",
"name": "InvalidRequest"
},
{
"description": "HTTP 400. A branch of the query names no `view` (curated or asWritten): there is no default. The message names the branch.",
"name": "ViewRequired"
},
{
"description": "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`.",
"name": "NotCurated"
},
{
"description": "HTTP 404. `queryUri` names no query record the caller may read.",
"name": "NotFound"
}
],
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"capped": {
"description": "True when the count stopped at 1000.",
"type": "boolean"
},
"count": {
"description": "Records counted (at most 1000).",
"type": "integer"
},
"groups": {
"description": "With groupBy: the count per key, largest first.",
"items": {
"ref": "#group",
"type": "ref"
},
"type": "array"
},
"notServedHere": {
"description": "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.",
"ref": "pub.techne.draft.query.listRecords#notServedHere",
"type": "ref"
}
},
"required": [
"count",
"capped"
],
"type": "object"
}
},
"parameters": {
"properties": {
"groupBy": {
"description": "Count per type or per author instead of in all.",
"knownValues": [
"type",
"author"
],
"type": "string"
},
"params": {
"description": "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,
"type": "string"
},
"query": {
"description": "A pub.techne.draft.query object, as JSON. Give this or `queryUri`.",
"maxLength": 16384,
"type": "string"
},
"queryUri": {
"description": "A published pub.techne.draft.query record to run. Give this or `query`.",
"format": "at-uri",
"type": "string"
}
},
"type": "params"
},
"type": "query"
}
},
"id": "pub.techne.draft.query.countRecords",
"lexicon": 1
}