Files
zkldi_Tachi/server/scripts/single-use/fix-user-goals.ts
T

33 lines
495 B
TypeScript

import db from "external/mongo/db";
if (require.main === module) {
(async () => {
const ugs = await db["user-goals"].find(
{},
{
projectID: true,
}
);
for (const ug of ugs) {
await db["user-goals"].update(
{
_id: ug._id,
},
{
$set: {
progressHuman: ug.progressHuman.toString(),
outOfHuman: ug.outOfHuman.toString(),
lastInteraction: null,
},
$unset: {
note: 1,
},
}
);
}
process.exit(0);
})();
}