[CSHARP-4549] Support Tuple.Create and ValueTuple.Create in projections Created: 27/Feb/23 Updated: 28/Oct/23 Resolved: 22/Mar/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | 2.19.0 |
| Fix Version/s: | 2.19.1 |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||
| Comments |
| Comment by Githook User [ 24/Mar/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 22/Mar/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Robert Stam [ 15/Mar/23 ] |
|
Thank you for reporting this. It ended being a bit of an overhaul of Tuple support in LINQ in general, not just adding support for the Create methods. The main change is that Tuples (as well as ValueTuples) are now serialized as arrays in LINQ the same way a Tuple property of a POCO would have been serialized. That also meant that tuple item references like `tuple.Item<n>` had to be translated to either `tuple.<n>` (in filters) or ` { $arrayElemAt : ["$tuple", <n>] }` (in aggregation expressions). |