From 807d7e10c395b6de977ecd587272e7db10224454 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 2 Jul 2026 10:55:57 -0700 Subject: [PATCH] type bulk op --- server/src/db/migration/0002_convertChecksToTimeSeries.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/db/migration/0002_convertChecksToTimeSeries.ts b/server/src/db/migration/0002_convertChecksToTimeSeries.ts index 91170050b..0c171744f 100644 --- a/server/src/db/migration/0002_convertChecksToTimeSeries.ts +++ b/server/src/db/migration/0002_convertChecksToTimeSeries.ts @@ -1,5 +1,5 @@ import mongoose from "mongoose"; -import type { Document, AnyBulkWriteOperation } from "mongodb"; +import type { Document } from "mongodb"; const CHECKS_COLLECTION = "checks"; const BACKUP_COLLECTION = "checks_backup"; @@ -144,7 +144,11 @@ const migrateBackupData = async (backedUp: boolean): Promise => stats.totalSource = await source.countDocuments(); const cursor = source.find(); - const operations: AnyBulkWriteOperation[] = []; + // Derive the op type from the exact bulkWrite we call so it matches whichever `mongodb` copy + // Mongoose resolves (a fresh Docker/multiarch install nests its own under mongoose/node_modules, + // distinct from the top-level one — importing AnyBulkWriteOperation from "mongodb" picks the wrong copy). + type BulkOp = Parameters[0][number]; + const operations: BulkOp[] = []; const invalidDocs: Document[] = []; while (await cursor.hasNext()) {