[CSHARP-1750] Add support for $addFields aggregation stage Created: 19/Aug/16 Updated: 04/May/23 Resolved: 29/Aug/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Rathi Gnanasekaran | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | MongoDB 3.4 | ||||||||
| Server Compat: | 3.3 | ||||||||
| Description |
| Comments |
| Comment by Corey Forbes [ 04/May/23 ] |
|
I was trying to use this $addField/$set functionality to add a value to a pre-modeled document that contains a dictionary. This could not be pre-calculated for the document to save but instead the storage depends on input factors and at run time e.g. Which queries did this specific document meet so that we can next sort and paginate appropriately. This would be great to see revisited. |
| Comment by Christopher Sena [ 08/May/17 ] |
|
But this can apply to a type-safe API the result can just be cast to the a new type (with the extra field). Doesn't this miss the whole point of the $addFields aggregation stage? Surely this could be achieved in C# with something like.. IAggregateFluent<TNewResult> AddField<TResult,TNewResult>(Expression<Func<TResult, TField>> newFieldExpression, Expression<Func<TNewResult, TField>> newFieldLocation) Sort of similar to how a lookup is added. This would really help. |
| Comment by Craig Wilson [ 29/Aug/16 ] |
|
This doesn't apply to a type-safe API, so nothing to do for LINQ. |