From 0fac59967a4572ad769792366f76a1440e7f8d7e Mon Sep 17 00:00:00 2001 From: sunghyunkang1111 <114709653+sunghyunkang1111@users.noreply.github.com> Date: Thu, 20 Nov 2025 12:23:24 -0600 Subject: [PATCH] Fix mongo database name handling (#2262) --- utils/cleanupDBs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/cleanupDBs.js b/utils/cleanupDBs.js index 723ec1c73..e0a42d946 100644 --- a/utils/cleanupDBs.js +++ b/utils/cleanupDBs.js @@ -28,7 +28,7 @@ async function main() { const mongoDatabases = await client.mongoDBResources.listMongoDBDatabases(resourceGroupName, account.name); for (const database of mongoDatabases) { // Unfortunately Mongo does not provide a timestamp in ARM. There is no way to tell how old the DB is other thn encoding it in the ID :( - const timestamp = Number(database.name.split("-")[1]); + const timestamp = Number(database.name.split("_").pop()); if (timestamp && timestamp < thirtyMinutesAgo) { await client.mongoDBResources.deleteMongoDBDatabase(resourceGroupName, account.name, database.name); console.log(`DELETED: ${account.name} | ${database.name} | Age: ${friendlyTime(Date.now() - timestamp)}`);