Return distinct values for a single field.
Changed onReturn the set of unique values for one document field across a collection, together with a per-value document count sorted desc. Thin wrapper over /aggregate for the common SELECT DISTINCT <field> case — use this when a UI needs a facet list (e.g. brand_slug) without loading every document. Null/missing values are excluded. A value comes back as a JSON number or boolean when the namespace declares a payload index of type integer, float or bool on the field. Any other field, including an undeclared numeric one, facets as strings, so check the namespace's payload_indexes to know which you will get. When a storage shard times out or returns only part of its documents, the list can be short: query_info.truncated is then true and query_info.warning says what to do.
Request
- Base URLhttps://api.mixpeek.com
- AuthHTTP bearer and API key in header X-Namespace
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The unique identifier of the collection.
Request body
Example request
{
"field": "brand_slug"
}Response
Successful Response
Changes
- info
added the optional property
to the response with the status
- info
- warning
removed the optional property
from the response with the status - info
added the non-success response with the status
- info
added the non-success response with the status
- info
added the optional property
to the response with the status - info
added the required property
to the response with the status - info
added the required property
to the response with the status
- warning