[SERVER-5991] $project does not allow creation of a new field with literal value Created: 01/Jun/12 Updated: 15/Feb/13 Resolved: 27/Aug/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.1.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Mathias Stearn |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
$project allows insertion of new computed fields, however it doesn't seem to allow insertion of new literal fields. {$project : {"newfield":"abc"}} It would be nice to not have to hack around it via: Possibly related to https://jira.mongodb.org/browse/SERVER-5762 and https://jira.mongodb.org/browse/SERVER-5782 |
| Comments |
| Comment by Mathias Stearn [ 16/Jul/12 ] |
|
Actually the current implemention of $literal is slated for removal because it is known to be broken. I think there is a 5-min replacement, but if it takes longer there will be no $literal in 2.2. |
| Comment by Asya Kamsky [ 14/Jul/12 ] |
|
looks like the current implementation of $literal resolves this case. |