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
  • Entity Query vs Instance Query

Entity Query vs Instance Query · Changes

Page history
Create Entity Query vs Instance Query authored Mar 09, 2022 by Andrea Pavlovic's avatar Andrea Pavlovic
Show whitespace changes
Inline Side-by-side
Entity-Query-vs-Instance-Query.md 0 → 100644
View page @ cf484566
Once the internal ID of a database entry is known, there are two API endpoints available to retrieve this entity.
Of course, the query endpoint would work:
`POST /data/system/entity/query`
```json
{
"conds": {
"me.id": 2
}
}
```
But this also does a table and result count to include in the reply, so the instance queries which do not do so will be faster.
To get only the instance itself, no joined data:
`GET /data/system/entity/2`
Should you need joins of function calls etc:
`POST /data/system/entity/2/query`
```json
{
"attrs": {
"prefetch": [
"module"
],
"+select": [
{
"coalesce": "me.description,me.label"
}
],
"+as": [
"mytext"
]
}
}
```
\ No newline at end of file
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