Querying Documents
Thequery
command allows you to search for and manipulate documents in a document store:
Filtering Results
You can filter results using specific queries:Sorting Results
Sort results by specific fields:Pagination and Streaming
For large result sets, use pagination:Multithreaded Operations
Speed up operations with multiple threads:Downloading Documents
Download KDDB Format
Download documents in Kodexa Document Database (KDDB) format:<document-path>.kddb
Download Native Files
Download the original native files:<document-path>.native
Download Extracted Data
Download extracted data as JSON:<document-path>-extracted_data.json
Specify a project ID for extracted data:
Reprocessing Documents
Reprocess documents using a specific assistant:Labeling Documents
Add labels to documents:Watching for Changes
Monitor and refresh results periodically:Deleting Documents
Delete documents matching a query:Uploading Documents
Theupload
command allows you to upload files to a document store:
Upload With External Data
You can attach external data to uploaded documents:document.json
for document.pdf
) and attaches its content as external data to the uploaded document.
Multithreaded Uploads
For faster uploads of multiple files:Advanced Examples
Search and download with multiple options
Reprocess all invoices with a new assistant
Monitor document store for changes
Complex filtering with sorting
Bulk operations with confirmation
Upload with parallel processing
Query Options Reference
Option | Description | Example |
---|---|---|
--filter | Use filter syntax instead of query syntax | --filter |
--page | Page number for pagination | --page 2 |
--pageSize | Number of items per page | --pageSize 20 |
--sort | Sort results by field | --sort "name:asc" |
--stream | Stream results instead of paginating | --stream |
--limit | Limit number of results in streaming | --limit 100 |
--threads | Number of threads for operations | --threads 10 |
--download | Download documents in KDDB format | --download |
--download-native | Download original files | --download-native |
--download-extracted-data | Download extracted data as JSON | --download-extracted-data |
--project-id | Project ID for extracted data | --project-id proj123 |
--reprocess | Reprocess with assistant ID | --reprocess asst123 |
--add-label | Add label to documents | --add-label invoice |
--remove-label | Remove label from documents | --remove-label draft |
--delete | Delete matching documents | --delete |
--watch | Refresh results every n seconds | --watch 30 |
Upload Options Reference
Option | Description | Example |
---|---|---|
--threads | Number of threads for parallel uploads | --threads 10 |
--external-data | Attach JSON metadata from matching files | --external-data |