[SERVER-36100] Allow missing "_id" from extracted unique key in a $out pipeline Created: 12/Jul/18  Updated: 29/Oct/23  Resolved: 30/Aug/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.1.3

Type: Task Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Kyle Suarez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-35896 Support "replaceDocuments" mode in $out Closed
Documented
is documented by DOCS-12017 Docs for SERVER-36100: Allow missing ... Closed
Duplicate
is duplicated by SERVER-36598 aggregate $out fails when the _id is ... Closed
Backwards Compatibility: Major Change
Sprint: Query 2018-07-30, Query 2018-08-13, Query 2018-08-27, Query 2018-09-10
Participants:

 Description   

If the uniqueKey contains _id, we should relax the enforcement that all fields of the unique key must be present in a given document since the update/insert should auto generate an _id for us. 



 Comments   
Comment by Githook User [ 30/Aug/18 ]

Author:

{'name': 'Kyle Suarez', 'email': 'kyle.suarez@mongodb.com', 'username': 'ksuarz'}

Message: SERVER-36100 generate _id for $out uniqueKey if not present

If the _id field is part of the $out "uniqueKey" but is not present in
the document at the time of write, the $out stage will generate it
automatically.

We won't generate an _id if if isn't part of the "uniqueKey" so that
DocumentSourceOutInPlaceReplace won't use it as part of the update.
Branch: master
https://github.com/mongodb/mongo/commit/b46de3f6c06fab5cf9b7ea0f4176b32ff544a4bf

Generated at Thu Feb 08 04:42:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.