Loan management sample database — MongoDB, embedded (243,077 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 — 2,500 documents
  application_documents — 8,000 documents
  application_reviews — 3,800 documents
  audit_logs — 3,000 documents
  branch_targets — 100 documents
  branches — 25 documents
  collateral_types — 8 documents
  collaterals — 1,600 documents
  collections — 1,000 documents
  credit_scores — 3,000 documents
  customers — 2,200 documents, each with its customer_references
  delinquencies — 500 documents
  departments — 8 documents
  disbursements — 2,500 documents
  employees — 130 documents
  fee_types — 8 documents
  guarantors — 1,000 documents
  insurance_policies — 1,300 documents
  legal_actions — 100 documents
  loan_applications — 3,800 documents
  loan_fees — 3,800 documents
  loan_products — 12 documents
  loan_reschedules — 200 documents
  payment_methods — 6 documents
  payments — 50,000 documents, each with its payment_allocations
  penalties — 2,500 documents
  repayment_schedules — 50,000 documents
  write_offs — 80 documents

Folded in (no collection of their own):
  customer_references — 1,900 rows, as the "customer_references" array on customers (its customer_id is the parent's _id)
  payment_allocations — 100,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.
