Loan management sample database — MongoDB, embedded (2,430,167 rows)

Tables that belong to another are folded into it as arrays, so the documents read the way the application uses them. The rest are collections of their own, joined by key as in the flat version.

Load it:
  sh import.sh                    (into mongodb://localhost:27017)
  sh import.sh "<connection string>"

Or one collection at a time: mongoimport --db loan-management --collection <name> --file <name>.ndjson

Collections:
  active_loans — 25,000 documents
  application_documents — 80,000 documents
  application_reviews — 38,000 documents
  audit_logs — 30,000 documents
  branch_targets — 1,000 documents
  branches — 25 documents
  collateral_types — 8 documents
  collaterals — 16,000 documents
  collections — 10,000 documents
  credit_scores — 30,000 documents
  customers — 22,000 documents, each with its customer_references
  delinquencies — 5,000 documents
  departments — 8 documents
  disbursements — 25,000 documents
  employees — 1,300 documents
  fee_types — 8 documents
  guarantors — 10,000 documents
  insurance_policies — 13,000 documents
  legal_actions — 1,000 documents
  loan_applications — 38,000 documents
  loan_fees — 38,000 documents
  loan_products — 12 documents
  loan_reschedules — 2,000 documents
  payment_methods — 6 documents
  payments — 500,000 documents, each with its payment_allocations
  penalties — 25,000 documents
  repayment_schedules — 500,000 documents
  write_offs — 800 documents

Folded in (no collection of their own):
  customer_references — 19,000 rows, as the "customer_references" array on customers (its customer_id is the parent's _id)
  payment_allocations — 1,000,000 rows, as the "payment_allocations" array on payments (its payment_id is the parent's _id)

Types: numeric columns are Decimal128, so totals stay exact; dates and timestamps are
Date values read as UTC (the data has no time zone); times and UUIDs are strings;
JSON columns are embedded objects.

Synthetic data, CC0-1.0, from databasesample.com. The same rows as the SQL and CSV files.
