Description
openedon May 23, 2024
We need to generally think about how this is handled, not just in Cosmos; in relational, ToList() is handled very specifically in RelationalProjectionBindingEV - not sure if e.g. ToArray() works.
Also, think about whether ToList() should be handled purely as a Select() phenomenon (i.e. in ProjectionBindingEV). In Cosmos, it probably makes sense for ToList() to be generally translatable to ARRAY()
, i.e. as a way to convert the results of a subquery to a collection scalar. This could also make sense in relational (e.g. array_agg on PG). On the other hand, ToList() seems to be useful mostly/only in projections, since one can simply e.g. compare the results of a subquery directly to some array (Where(b => b.Ints.Where(...) == b.Ints2
- this applies ARRAY() as well).