| import { getMongoDb } from '../lib/mongo.js'; | |
| import { ensureArchiveDb } from '../db/indexes.js'; | |
| async function main() { | |
| const db = await getMongoDb(); | |
| await ensureArchiveDb(db); | |
| const collections = await db.listCollections({}, { nameOnly: true }).toArray(); | |
| console.log('Mongo archive initialized. Collections:', collections.map((c) => c.name).sort().join(', ')); | |
| } | |
| main() | |
| .then(() => { | |
| process.exit(0); | |
| }) | |
| .catch((error) => { | |
| console.error('Failed to initialize Mongo archive:', error); | |
| process.exit(1); | |
| }); | |