Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use aggregates in self resource #105

Open
ThanhSonITNIC opened this issue Feb 15, 2024 · 1 comment
Open

How to use aggregates in self resource #105

ThanhSonITNIC opened this issue Feb 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ThanhSonITNIC
Copy link
Contributor

ThanhSonITNIC commented Feb 15, 2024

Description

Stats api as my recommended below or have any other solution?

// (POST) api/posts/search

{
  "search": {
    "aggregates": [
      {
        "type": "count",
        "filters": [
          {"field": "published", "value": true}
        ]
      }
    ]
  }
}

my wish response

{
    "current_page": 1,
    "data": [],
    "from": 1,
    "last_page": 1,
    "per_page": 50,
    "to": 2,
    "total": 2,
    "meta": {
        "count_published": 1 // number of published posts
    }
}
@GautierDele
Copy link
Member

Aggregates are meant to be called on models effectively, i'll let this open in order to find a solution

@GautierDele GautierDele added the enhancement New feature or request label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants