docs: document ktx mongo-query command

This commit is contained in:
Kevin Messiaen 2026-07-06 20:20:46 +07:00
parent 10de18d63f
commit afb8a2d234
No known key found for this signature in database
GPG key ID: 19FF750A17315202
3 changed files with 112 additions and 0 deletions

View file

@ -735,6 +735,7 @@ nullability from how often the field is present:
| Table sampling | Yes | Reads the most recent documents |
| Nested analysis | Yes | Sub-documents and arrays modeled as opaque `json` |
| Read-only SQL (`ktx sql`) | No | MongoDB is not a SQL source |
| Row queries (`ktx mongo-query`) | Yes | Runs a read-only aggregation pipeline against a collection |
### Dialect notes
@ -746,6 +747,13 @@ nullability from how often the field is present:
- `sample_size` trades inference coverage for speed; raise it for collections
with highly variable documents
### Querying rows
MongoDB is not SQL-queryable, so `ktx sql` refuses a mongodb connection. Use
[`ktx mongo-query`](/docs/cli-reference/ktx-mongo-query) to fetch rows by
running a MongoDB aggregation pipeline, or the `mongo_query` MCP tool for the
same capability from an agent client.
## Common errors
| Error or symptom | Likely cause | Recovery |