/** * Export tractatus-framework-research document to JSON file */ const { MongoClient } = require('mongodb'); const fs = require('fs'); async function run() { const devClient = new MongoClient('mongodb://localhost:27017'); await devClient.connect(); const devDoc = await devClient.db('tractatus_dev').collection('documents').findOne({ slug: 'tractatus-framework-research' }); await devClient.close(); if (!devDoc) { console.log('❌ Document not found in dev'); process.exit(1); } // Prep for production delete devDoc._id; devDoc.category = 'research-theory'; devDoc.order = 2; devDoc.visibility = 'public'; devDoc.updated_at = new Date(); // Write to file fs.writeFileSync( '/tmp/tractatus-framework-research.json', JSON.stringify(devDoc, null, 2) ); console.log(`✅ Exported: ${devDoc.title}`); console.log(` Sections: ${devDoc.sections?.length || 0}`); console.log(` File: /tmp/tractatus-framework-research.json`); } run().catch(console.error);