{
  "topic": "errors.DUPLICATE_AGGREGATION_ALIAS",
  "path": [
    "errors",
    "DUPLICATE_AGGREGATION_ALIAS"
  ],
  "title": "DUPLICATE_AGGREGATION_ALIAS — two aggregations claim the same response key",
  "synopsis": "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.",
  "body": "# errors.DUPLICATE_AGGREGATION_ALIAS\n\n## NAME\n\nDUPLICATE_AGGREGATION_ALIAS — two aggregations over different `(op, field)` pairs resolve to the same key in the response.\n\n## SYNOPSIS\n\nHTTP: `400` `Bad Request`. Retryable: `no`.\n\n## DESCRIPTION\n\nRaised 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.\n\nThe 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.\n\nRepeating the *same* `(op, field)` pair does not raise this — identical pairs are deduplicated silently, since both would compute the same value.\n\nGive the colliding aggregations distinct `as` aliases.\n\n## SEE ALSO\n\n- errors\n- crud\n- errors.INVALID_AGGREGATION_OP\n- errors.INVALID_AGGREGATION_FIELD\n",
  "sections": [
    {
      "name": "NAME",
      "body": "DUPLICATE_AGGREGATION_ALIAS — two aggregations over different `(op, field)` pairs resolve to the same key in the response."
    },
    {
      "name": "SYNOPSIS",
      "body": "HTTP: `400` `Bad Request`. Retryable: `no`."
    },
    {
      "name": "DESCRIPTION",
      "body": "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.\n\nThe 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.\n\nRepeating the *same* `(op, field)` pair does not raise this — identical pairs are deduplicated silently, since both would compute the same value.\n\nGive the colliding aggregations distinct `as` aliases."
    },
    {
      "name": "SEE ALSO",
      "body": "- errors\n- crud\n- errors.INVALID_AGGREGATION_OP\n- errors.INVALID_AGGREGATION_FIELD"
    }
  ],
  "see_also": [
    "errors",
    "crud",
    "errors.INVALID_AGGREGATION_OP",
    "errors.INVALID_AGGREGATION_FIELD"
  ],
  "stability": "stable",
  "actions": []
}
