Skip to content

Commit

Permalink
Delete dummy translations
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvarela committed Apr 16, 2024
1 parent b8348cc commit bdf9477
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const languages = require('../i18n/config.json');

/**
*
* @param {{context: {client: import('mongodb').MongoClient}}} context
*/

exports.up = async ({ context: { client } }) => {
const db = client.db('translations');

for (const language of languages) {
const name = `reports_${language.code}`;

console.log(`Deleting dummy translations from ${name}`);

const translations = db.collection(name);

const result = await translations.deleteMany({
text: /^translated-/,
});

console.log(`Deleted ${result.deletedCount} dummy translations for ${language.code}`);
}
};

0 comments on commit bdf9477

Please sign in to comment.