Subscription SaaS sample database — MongoDB, embedded (2,317,080 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 subscription --collection <name> --file <name>.ndjson

Collections:
  apikeys — 30,000 documents
  apirequests — 1,000,000 documents
  access_tokens — 50,000 documents
  activity_log — 100,000 documents
  audit_logs — 30,000 documents
  billing_invoices — 250,000 documents
  discounts — 8 documents
  messages — 30,000 documents
  notifications — 80,000 documents
  payment_methods — 60,000 documents
  payments — 240,000 documents
  review_comments — 10,000 documents
  roles — 4 documents
  subscription_analytics — 2,000 documents
  subscription_categories — 6 documents, each with its subscription_category_mapping
  subscription_reviews — 10,000 documents
  subscriptions — 8 documents, each with its subscription_features
  support_tickets — 10,000 documents
  system_logs — 30,000 documents
  ticket_responses — 20,000 documents
  user_subscriptions — 60,000 documents
  users — 50,000 documents, each with its user_addresses, its user_discounts, its user_feedback, its user_preferences, its user_profiles, its user_roles

Folded in (no collection of their own):
  subscription_category_mapping — 14 rows, as the "subscription_category_mapping" array on subscription_categories (its category_id is the parent's _id)
  subscription_features — 40 rows, as the "subscription_features" array on subscriptions (its subscription_id is the parent's _id)
  user_addresses — 50,000 rows, as the "user_addresses" array on users (its user_id is the parent's _id)
  user_discounts — 15,000 rows, as the "user_discounts" array on users (its user_id is the parent's _id)
  user_feedback — 10,000 rows, as the "user_feedback" array on users (its user_id is the parent's _id)
  user_preferences — 80,000 rows, as the "user_preferences" array on users (its user_id is the parent's _id)
  user_profiles — 50,000 rows, as the "user_profiles" array on users (its user_id is the parent's _id)
  user_roles — 50,000 rows, as the "user_roles" array on users (its user_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.
