Skip to main content

tcb db nosql dump

Export the data of a collection.

Usage​

tcb db nosql dump <collection> [options]

Parameters​

ParameterRequiredDescriptionDefault
<collection>YesCollection to export—
--file-type <fileType>NoExport format, json or csvjson
--fields <fields>NoComma-separated field names to export, required with csv—
--output-dir <outputDir>NoLocal directory to download the file into, prints the download URL when omitted—
-e, --env-id <envId>NoEnvironment 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 csv requires --fields
  • Exported files may contain sensitive business data, keep the download URL and the local files safe and out of the repository