Aggregate Notes
aggregate_documentsGroups matching indexed notes into count-ranked frequency buckets by folder, tag, or UTC month, using filters and full-text queries to summarize vault distribution.
Instructions
Group every matching indexed note into bounded frequency buckets.
Counts cover the whole population. Multi-value tag buckets can sum above
total; missing counts notes without a tag value. UTC months use YYYY-MM.
Buckets rank by count descending then key.casefold() and raw key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | Yes | Group by folder, configured tag field or UTC modification month. | |
| path | No | Case-sensitive exact vault-relative path, including .md. | |
| field | No | Indexed field for tag grouping; ignored for folder/month. | tags |
| limit | No | Maximum returned buckets, 1-1000; never caps the input population. | |
| query | No | FTS5 expression; blank selects all indexed notes. Malformed syntax matches its literal words. | |
| scope | No | Indexed columns to match: metadata (path, title, headings, summary), body, or all. Terms must match within one indexed section. | all |
| folder | No | Restrict to this folder and descendants; empty selects root notes. | |
| filters | No | AND equality over fields in indexed_frontmatter_fields from stats. List fields match a member; computed OKF fields use search instead. | |
| pattern | No | Case-sensitive path glob; *, ? and bracket classes are wildcards. | |
| modified_after | No | Inclusive RFC3339 modification instant with timezone. | |
| modified_before | No | Exclusive RFC3339 modification instant with timezone. | |
| wait_for_pending_writes | No | Wait for recent index writes. On timeout, answer from the current index with _meta.index_stale=true. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | ||
| buckets | Yes | ||
| missing | Yes | ||
| truncated | Yes | ||
| index_stale | Yes |