File size: 542 Bytes
6782be3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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);
});
|