Skip to content

Commit 1c163e9

Browse files
Copilothotlong
andcommitted
Add type assertion and clarifying comment for atomic operator handling
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9e5fe90 commit 1c163e9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/drivers/mongo/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ export class MongoDriver implements Driver {
442442
let update: UpdateFilter<any>;
443443
if (isAtomic) {
444444
// When using atomic operators, add updated_at to $set
445-
update = { ...updateData };
445+
// The spread is safe because id and created_at were already removed via destructuring
446+
update = { ...updateData } as any;
446447
if (!update.$set) {
447448
update.$set = {};
448449
}

0 commit comments

Comments
 (0)