How to use groupby, alias and aggregate in REST request?

Viewed 383

I am on directus v9.0.0-rc.93. I want to use aggregation, grouping and alias in API request.

The thing is I am doing as per the doc and none of them are working individually or all together.

Here is my postman request. postman screenshot

In the response I am getting array of the object containing userid, earnedpoints cardcolor only nothing else. ‍♂️

response

{
    "meta": {
        "total_count": 9,
        "filter_count": 8
    },
    "data": [
        {
            "userid": 1,
            "earnpoints": 1000,
            "cardcolor": "#E35169"
        },
        {
            "userid": 1,
            "earnpoints": 1000,
            "cardcolor": "#F7971C"
        },
        {
            "userid": 1,
            "earnpoints": 1000,
            "cardcolor": "#9E8DE4"
        },
        {
            "userid": 1,
            "earnpoints": 10,
            "cardcolor": null
        },
        {
            "userid": 1,
            "earnpoints": 5,
            "cardcolor": null
        },
        {
            "userid": 1,
            "earnpoints": 10,
            "cardcolor": null
        },
        {
            "userid": 1,
            "earnpoints": 5,
            "cardcolor": null
        },
        {
            "userid": 1,
            "earnpoints": 3505,
            "cardcolor": null
        }
    ]
}

I am not getting any other columns like alias which I set nor I am getting the result of aggregation function.

0 Answers
Related