Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 30 lines 1.3 kB view raw
1// Quick verification script 2import { MongoClient } from 'mongodb'; 3import 'dotenv/config'; 4 5const client = new MongoClient(process.env.MONGODB_CONNECTION_STRING); 6await client.connect(); 7const db = client.db(process.env.MONGODB_NAME); 8const paintings = db.collection('paintings'); 9 10const total = await paintings.countDocuments(); 11const withCodes = await paintings.countDocuments({ code: { $exists: true } }); 12const users = await paintings.countDocuments({ user: { $exists: true }, code: { $exists: true } }); 13const guests = await paintings.countDocuments({ user: { $exists: false }, code: { $exists: true } }); 14 15console.log('\n📊 Verification Results:\n'); 16console.log(` Total paintings: ${total}`); 17console.log(` With codes: ${withCodes} (${(withCodes/total*100).toFixed(1)}%)`); 18console.log(` User paintings: ${users}`); 19console.log(` Guest paintings: ${guests}`); 20 21console.log('\n📝 Sample paintings:\n'); 22const samples = await paintings.find({ code: { $exists: true } }).sort({ when: -1 }).limit(10).toArray(); 23 24for (const p of samples) { 25 const user = p.user ? `user: ${p.user.substring(0,12)}` : 'guest'; 26 const date = new Date(p.when).toISOString().split('T')[0]; 27 console.log(` #${p.code.padEnd(4)} | ${date} | ${user.padEnd(18)} | ${p.slug.substring(0,25)}`); 28} 29 30await client.close();