dotnet / dotnet/efcore

Cosmos: supporting projecting out arrays directly, without wrapping in an object

Open
#33,779 0 comments 0 reactions 0 assignees View on GitHub
area-cosmos area-query
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

For example, test PrimitiveCollectionsQueryCosmosTest.Project_inline_collection:

```c#
public virtual Task Project_inline_collection(bool async)
=> AssertQuery(
async,
ss => ss.Set().Select(x => new[] { x.String, "foo" }),
elementAsserter: (e, a) => AssertCollection(e, a, ordered: true),
assertOrder: true);
```

Current SQL:

```sql
SELECT VALUE {"c" : [c["String"], "foo"]}
FROM root c
WHERE (c["Discriminator"] = "PrimitiveCollectionsEntity")
```

We should have `SELECT VALUE [c["String"], "foo"]` instead.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.