Skip to main content
The convex data command allows you to inspect your Convex deployment’s database directly from the command line.

Usage

Arguments

string
If specified, list documents in this table. If omitted, lists all tables in the database.

Options

number
default:100
List only the n most recently created documents.Must be a positive integer.
string
default:"desc"
Order the documents by their _creationTime.Choices: asc, desc
  • asc - Oldest documents first
  • desc - Newest documents first
string
Path to the component in the component tree defined in convex.config.ts.Components are a beta feature.
string
Format to print the data in.Choices: jsonArray, json, jsonLines, jsonl, pretty
  • jsonArray (or json) - Print the data as a JSON array of objects
  • jsonLines (or jsonl) - Print the data as a JSON object per line
  • pretty - Print the data in a human-readable format (default for terminal output)

Examples

List all tables

List all tables in your deployment:
Output:

List documents in a table

View the most recent documents in the users table:

Limit results

Show only the 10 most recent documents:

Show oldest documents

List documents in ascending order by creation time:

Export as JSON

Output data in JSON format for processing:

Export as JSON Lines

Output data as JSON Lines for streaming or line-by-line processing:

Query production data

List tables in your production deployment:

Query component data

List documents from a table in a component:

Output formats

Pretty format (default)

Human-readable table format:

JSON Array format

JSON Lines format

Deployment selection

The convex data command supports deployment selection:
  • --prod - Target production deployment
  • --preview-name <name> - Target a preview deployment
  • --url <url> - Target a specific deployment URL
  • --admin-key <key> - Admin key for authentication
By default, the command targets your dev deployment.

System fields

All documents include these system fields:
  • _id - Unique document identifier
  • _creationTime - Timestamp when the document was created (milliseconds since epoch)

Use cases

Debugging

Quickly inspect data during development:

Data export

Export data for analysis or backup:

Schema verification

Check what tables exist in your deployment:

Production monitoring

Quickly check recent data in production:

Limitations

  • Maximum limit is bounded by deployment limits
  • Large datasets should use the export command instead
  • Does not support filtering beyond creation time ordering
  • For complex queries, use convex run to execute custom query functions