From 4d87679adcccab3490e167f9524bcf63f99531bb Mon Sep 17 00:00:00 2001 From: Ijemma Onwuzulike Date: Fri, 6 Dec 2024 17:53:57 -0600 Subject: [PATCH] fix: removes crowdsourcing field on wordsuggesitons anad examplesuggestions collections --- .../20241206235108-remove-crowdsourcing.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 migrations/20241206235108-remove-crowdsourcing.js diff --git a/migrations/20241206235108-remove-crowdsourcing.js b/migrations/20241206235108-remove-crowdsourcing.js new file mode 100644 index 00000000..a61c1ae3 --- /dev/null +++ b/migrations/20241206235108-remove-crowdsourcing.js @@ -0,0 +1,17 @@ +module.exports = { + async up(db) { + const collections = ['wordsuggestions', 'examplesuggestions']; + await Promise.all( + collections.map(async (collection) => { + db.collection(collection).updateMany( + {}, + { + $unset: { crowdsourcing: null }, + } + ); + }) + ); + }, + + async down() {}, +};