tcb db nosql dump
Export the data of a collection.
Usage
tcb db nosql dump <collection> [options]
Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
<collection> | Yes | Collection to export | — |
--file-type <fileType> | No | Export format, json or csv | json |
--fields <fields> | No | Comma-separated field names to export, required with csv | — |
--output-dir <outputDir> | No | Local directory to download the file into, prints the download URL when omitted | — |
-e, --env-id <envId> | No | Environment ID | — |
When the export finishes, the CLI downloads the file into --output-dir; without it the command prints the download URL. With the global --json option, the output includes the task ID, task status, succeeded and failed record counts, and the download URL or local file path.
Examples
# Export the users collection as JSON and print the download URL
tcb db nosql dump users -e my-env-id
# Download the orders collection as a JSON file into a local directory
tcb db nosql dump orders \
--file-type json \
--output-dir ./exports \
-e my-env-id
# Export specific fields as CSV into a local directory
tcb db nosql dump users \
--file-type csv \
--fields _id,name,createdAt \
--output-dir ./exports \
-e my-env-id
Notes
--file-type csvrequires--fields- Exported files may contain sensitive business data, keep the download URL and the local files safe and out of the repository