diff --git a/server/src/db/migration/0005_migrateStatusPageTypeToArray.ts b/server/src/db/migration/0005_migrateStatusPageTypeToArray.ts index e94976262..9b8c638b6 100644 --- a/server/src/db/migration/0005_migrateStatusPageTypeToArray.ts +++ b/server/src/db/migration/0005_migrateStatusPageTypeToArray.ts @@ -20,17 +20,20 @@ export async function migrateStatusPageTypeToArray(): Promise { } // Find all status pages where `type` is a string (not yet migrated) - const result = await StatusPageModel.updateMany({ - $expr: { - $eq: [{ $type: "$type" }, "string"], // only scalar string, not existing array - } - }, [ + const result = await StatusPageModel.updateMany( { - $set: { - type: ["$type"], + $expr: { + $eq: [{ $type: "$type" }, "string"], // only scalar string, not existing array }, }, - ]); + [ + { + $set: { + type: ["$type"], + }, + }, + ] + ); if (result.modifiedCount === 0) { logger.info({ service: SERVICE_NAME, message: "No StatusPage documents needed migration" });