()
| 17522 | model[field] = value; |
| 17523 | } |
| 17524 | |
| 17525 | modelUpdates.push({ filePath, model }); |
| 17526 | console.log(`[${i}] Added to batch: ${filePath}, field ${field} = ${value}`); |
| 17527 | } else { |
| 17528 | console.warn(`[${i}] Skipping null result at index ${i}`); |
| 17529 | } |
| 17530 | } |
| 17531 | console.log(`Prepared ${modelUpdates.length} models for batch update`); |
| 17532 | |
| 17533 | // Save all models in a single bulk update |
| 17534 | if (modelUpdates.length > 0) { |
| 17535 | const modelDataBatch = modelUpdates.map(({ model }) => model); |
no test coverage detected