Skip to content

Document the meta query parameter #772

Description

@kheiner

Background

content/guides/04.connect/3.query-parameters.md documents every other query parameter (fields, filter, search, sort, limit, offset, page, aggregate, groupBy, deep, alias, export, version, versionRaw, functions, backlink) with its own ## section, but meta has no section and isn't mentioned anywhere on the page or elsewhere in this repo.

meta was previously proposed for deprecation in favor of aggregation (directus/directus#15665), but that was closed as not planned in 2024 ("Not dropping it, it's too popular!"). It remains fully supported today.

Scope

Add a ## Meta section to content/guides/04.connect/3.query-parameters.md, following the existing section format (description, ::code-group with REST/GraphQL/SDK tabs where applicable, any relevant ::callout).

Content notes

Source: api/src/utils/sanitize-query.ts (sanitizeMeta), api/src/services/meta.ts (MetaService.getMetaForQuery) in directus/directus.

  • Accepts total_count, filter_count, a comma-separated combination of the two, or * for both.
  • total_count: total number of items in the collection, ignoring any filters.
  • filter_count: number of items matching the current filter/search.
  • No GraphQL equivalent: GraphQL exposes counts through the separate <collection>_aggregated query type instead of a meta argument, so this section likely only needs REST + SDK tabs.

Also noticed

The page's frontmatter description field lists fields, filter, search, sort, limit, offset, page, aggregate, groupBy, deep, alias, and export - missing version, versionRaw, functions, and backlink (which already have sections), as well as meta. Worth updating in the same PR since it's the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions