Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos: Translate SelectMany #17312

Closed
Tracked by #25764
AndriySvyryd opened this issue Aug 20, 2019 · 3 comments · Fixed by #34013
Closed
Tracked by #25764

Cosmos: Translate SelectMany #17312

AndriySvyryd opened this issue Aug 20, 2019 · 3 comments · Fixed by #34013
Assignees
Labels
area-cosmos area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@AndriySvyryd
Copy link
Member

No description provided.

@roji
Copy link
Member

roji commented Nov 4, 2021

For at least most scenarios of SelectMany, SELECT * FROM c IN X.Y.Z seems perfect (see docs).

@gamontal
Copy link

@roji Can you please provide an example of an equivalent query translated to LINQ? I'm trying to filter a list of documents based on values located in nested collections. For example:

{
  "Id": "<id>",
  "collection1": [
    {
       "collection2": [
         "propToFilterOn": "<value>"
       ]
    }
  ]
}

I can retrieve the values using LINQ on the client-side:

entity.AsEnumerable().Where(e => e.collection1
                    .SelectMany(e => e.collection2).Any(d => d.propToFilterOn == "lookUpValue")))

But, if I try to run this directly against EF, I get a query translation exception.

@roji
Copy link
Member

roji commented Jun 23, 2022

@gamontal translating SelectMany on Cosmos isn't yet supported - that's why this issue is still open.

@smitpatel smitpatel removed their assignment Sep 14, 2022
@roji roji assigned roji and unassigned maumar Jun 16, 2024
@roji roji modified the milestones: Backlog, 9.0.0 Jun 16, 2024
roji added a commit to roji/efcore that referenced this issue Jun 16, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
roji added a commit to roji/efcore that referenced this issue Jun 16, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
roji added a commit to roji/efcore that referenced this issue Jun 17, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
roji added a commit to roji/efcore that referenced this issue Jun 17, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
roji added a commit to roji/efcore that referenced this issue Jun 18, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
roji added a commit to roji/efcore that referenced this issue Jun 20, 2024
Also introduces substantial infrastructure for general joins

Closes dotnet#17312
@roji roji closed this as completed in 7a5508b Jun 20, 2024
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-preview6 Jun 21, 2024
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jun 21, 2024
@roji roji modified the milestones: 9.0.0-preview6, 9.0.0 Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-cosmos area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants