import { config } from "dotenv";
config({ path: ".env.local" });
import { getDb } from "../lib/mongodb";

async function inspectDb() {
  const db = await getDb();
  const cols = await db.listCollections().toArray();
  console.log("Collections:", cols.map(c => c.name));
  for (const c of cols) {
    const count = await db.collection(c.name).countDocuments();
    console.log(` - ${c.name}: ${count}`);
  }
  process.exit(0);
}

inspectDb().catch(console.error);
