Skip to content

Commit 679c6dd

Browse files
hotlongCopilot
andauthored
更新 index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent feb6d60 commit 679c6dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/drivers/mongo/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class MongoDriver implements Driver {
189189

190190
// Map API document (id) to MongoDB document (_id) for update data
191191
// But we should not allow updating the _id field itself
192-
const { id: _, ...updateData } = data;
192+
const { id: _ignoredId, ...updateData } = data; // intentionally ignore id to prevent updating primary key
193193

194194
// Handle atomic operators if present
195195
const isAtomic = Object.keys(updateData).some(k => k.startsWith('$'));

0 commit comments

Comments
 (0)