You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mongo ORM: upsert treats an existing document holding only the filter's fields as an insert #30516
What a user sees. An upsert whose create sets a field that has an update default runs as one pipeline command that decides between insert and update by checking whether the matched document holds more than the filter's equality fields. If a document already exists whose only fields are the filter's fields (for example written by another tool), the ORM treats it as newly inserted: it writes the create values and skips the update default. Documents the ORM wrote always carry more fields, so ORM-only data is not affected.
Likely fix. Distinguish insert from update by a marker the server sets only on insert (for example compare $$ROOT against a $setOnInsert-only sentinel removed in the same pipeline), or document the limit next to upsert.
Found by review of the fixes for the Mongo defaults, codecs and Prisma 6 source project's manual QA.
Activity
fix(mongo): every value the ORM writes, reads or filters on goes thro…