[SERVER-42019] shorthand syntax for checking if _id value is missing Created: 30/Jun/19 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework, Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Participants: |
| Description |
|
In pipeline update specification it is common to check if a field doesn't exist and the way to tell if you're doing an upsert would be to check if _id doesn't exist. I'm proposing a shorthand syntax expression $onInsert or ifUpsert (exact work TBD) which would be short for:
|
| Comments |
| Comment by Asya Kamsky [ 30/Jun/19 ] |
|
This would be useful the same way $setOnInsert was used in regular update modifiers.
|