- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
const { MongoClient } = require('mongodb');
|
|
|
|
async function queryAllDocuments() {
|
|
const client = new MongoClient('mongodb://localhost:27017');
|
|
|
|
try {
|
|
await client.connect();
|
|
const db = client.db('tractatus_dev');
|
|
const collection = db.collection('documents');
|
|
|
|
const documents = await collection.find({
|
|
visibility: 'public'
|
|
})
|
|
.sort({ category: 1, order: 1, 'metadata.date_created': -1 })
|
|
.toArray();
|
|
|
|
console.log(`\n=== TOTAL DOCUMENTS: ${documents.length} ===\n`);
|
|
|
|
const byCategory = {};
|
|
documents.forEach(doc => {
|
|
const cat = doc.category || 'none';
|
|
if (!byCategory[cat]) {
|
|
byCategory[cat] = [];
|
|
}
|
|
byCategory[cat].push({
|
|
title: doc.title,
|
|
slug: doc.slug,
|
|
order: doc.order || 999,
|
|
category: doc.category || 'none',
|
|
quadrant: doc.quadrant || 'N/A',
|
|
audience: doc.audience || 'general'
|
|
});
|
|
});
|
|
|
|
Object.keys(byCategory).sort().forEach(category => {
|
|
console.log(`\n━━━ CATEGORY: ${category} (${byCategory[category].length} docs) ━━━`);
|
|
byCategory[category].forEach((doc, i) => {
|
|
console.log(`${i + 1}. [order:${doc.order}] ${doc.title}`);
|
|
console.log(` slug: ${doc.slug}`);
|
|
console.log(` quadrant: ${doc.quadrant} | audience: ${doc.audience}`);
|
|
});
|
|
});
|
|
|
|
} finally {
|
|
await client.close();
|
|
}
|
|
}
|
|
|
|
queryAllDocuments().catch(console.error);
|