FILES
What this covers: querying the FILES entity (20 rows; label field NAME).
Why you need it: list, fetch, count, and aggregate files; answer "which/how many/how much" questions.
Syntax:
LIST FILES [WHERE ...] [ORDER BY <FIELD> [DESC]] [LIMIT n] [OFFSET n]GET FILES "<name>"COUNT FILES [BY <FIELD>] [WHERE ...]SUM FILES <NUMERIC FIELD> [BY <FIELD>] [WHERE ...]RESOLVE FILES "<name>"- Operators: IS, IS_NOT, CONTAINS, GT, GTE, LT, LTE; combine with AND / OR.
Returns: JSON rows plus _meta (provenance, epoch, related follow-up queries, hints).
Workflows:
1. COUNT FILES - size the data before listing.
2. COUNT FILES BY IS_FOLDER then LIST FILES WHERE IS_FOLDER IS "no" LIMIT 10 - segment, then drill in.
3. SUM FILES DEPTH BY IS_FOLDER - aggregate by segment.
4. RESOLVE FILES "<fuzzy name>" then GET FILES "<canonical>" - resolve before fetching when a name lookup misses.
Constraints:
- Filter only on fields listed in HELP SCHEMA; unknown fields are hard errors.
- Enum values are exact strings (e.g. IS_FOLDER: no, yes).
- Default LIMIT is 100;
countin a LIST response is not the true total.