DUPLICATE_AGGREGATION_ALIAS — two aggregations claim the same response key
cyoda-go version 0.8.4
errors.DUPLICATE_AGGREGATION_ALIAS
Section titled “errors.DUPLICATE_AGGREGATION_ALIAS”DUPLICATE_AGGREGATION_ALIAS — two aggregations over different (op, field) pairs resolve to the same key in the response.
SYNOPSIS
Section titled “SYNOPSIS”HTTP: 400 Bad Request. Retryable: no.
DESCRIPTION
Section titled “DESCRIPTION”Raised by POST /api/entity/stats/{entityName}/{modelVersion}/query. Each bucket’s aggregations object is keyed by the aggregation’s as alias, or — when as is omitted — by a synthesized <op>_<field> with the leading $. stripped, so {"op":"sum","field":"$.amount"} becomes sum_amount. Two aggregations that compute different things cannot share one key, because only one of the two values could be returned under it.
The collision can arise between two explicit aliases, or between an explicit alias and a synthesized one (as: "sum_amount" on one entry alongside an unaliased sum over $.amount on another). The message carries the contested alias.
Repeating the same (op, field) pair does not raise this — identical pairs are deduplicated silently, since both would compute the same value.
Give the colliding aggregations distinct as aliases.
SEE ALSO
Section titled “SEE ALSO”- errors
- crud
- errors.INVALID_AGGREGATION_OP
- errors.INVALID_AGGREGATION_FIELD
See also
Section titled “See also”cyoda help errors— Every error response from the Cyoda REST API carries a structurederrorCodein thepropertiesobject. Multiple codes may share the same HTTP status. Programmatic handling keys onerrorCode, not HTTP status.cyoda help crud— Entities are instances of models. Each entity has a UUID, a model reference (entityName,modelVersion), and a lifecycle state managed by the workflow engine. Creating an entity requires the referenced model to be inLOCKEDstate. All write operations run within a Cyoda transaction and return atransactionIdalongside the affected entity IDs.cyoda help errors INVALID_AGGREGATION_OP— Raised byPOST /api/entity/stats/{entityName}/{modelVersion}/query. The supported operators aresum,avg,min,maxandstdev, spelled lowercase. Anything else — includingcount, an uppercase spelling, or a typo — is rejected, and the message echoes the value that was sent.cyoda help errors INVALID_AGGREGATION_FIELD— Raised byPOST /api/entity/stats/{entityName}/{modelVersion}/query. An aggregationfieldobeys exactly the grammar agroupBypath does — a required$.leader followed by dot-separated segments of ASCII letters, digits,_and-, with no bracket-quoted access, array subscript or projection, recursive descent, whitespace or non-ASCII character. Seecyoda help errors INVALID_GROUP_BY_PATHfor the grammar and the rejected spellings; the message names the offending field and the reason.
Raw formats
Section titled “Raw formats”/help/errors/duplicate_aggregation_alias.json— full descriptor (matchesGET /help/{topic}envelope)/help/errors/duplicate_aggregation_alias.md— body only