Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Api
  • Queries
  • Attributes

Attributes · Changes

Page history
attrs docu authored Jan 25, 2022 by Andrea Pavlovic's avatar Andrea Pavlovic
Hide whitespace changes
Inline Side-by-side
API/Queries/Attributes.md
View page @ 52887d35
...@@ -394,6 +394,51 @@ A column defined by select and as: ...@@ -394,6 +394,51 @@ A column defined by select and as:
# Group By # Group By
To group a result by one or more [columns](#permitted-column-names), `group_by` may be used.
## Restrictions
The value may be either one string or an array of strings of [permitted column names](#permitted-column-names).
## Examples
This will return a list of modules names and how many entites each modules has:
`POST /data/system/module/query`
```
{
"attrs": {
"join": "system__entity__module",
"columns": "me.name",
"+select": [
{
"count": "system__entity__module.id"
}
],
"+as": [
"entity_count"
],
"group_by": "me.name"
}
}
```
`POST /data/extensions/client_meta_data/query`
```json
{
"attrs": {
"select": [
{
"count": "me.id"
},
"settings->>'enabled'"
],
"group_by": "settings->>'enabled'"
}
}
```
# Collapse # Collapse
......
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages