Skip to main content
analyze reads the structure of a database — MongoDB or PostgreSQL — and reports what’s inside. Use it before running a cross-database migration to understand what you’re migrating.

Examples

Analyze MongoDB

Analyze PostgreSQL

What it reports

For MongoDB

  • Collection names and document counts
  • Field names per collection
  • Inferred types per field (with frequency if heterogeneous)
  • Nesting depth
  • Potential reference fields (_id patterns that look like foreign keys)
  • Index coverage

For PostgreSQL

  • Table names and row counts
  • Column types and nullability
  • Primary and foreign keys
  • Indexes
  • Sequence/identity columns

Sample output (MongoDB)

What to do with the output

Spot inconsistencies early

Mixed types and missing fields cause migration errors. Fix them in the source first when you can.

Plan the schema

Decide which nested objects to flatten vs keep as jsonb.

Pick batch size

Huge collections need smaller batches (see --batch-size).

Export to config

Save the proposed mapping with dbdock migrate --export-config.

Read-only

analyze only reads — it doesn’t modify the source database. Safe to run against production.

See also

dbdock migrate

Run the actual migration.

Schema mapping

How DBDock maps types.