-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Description
We don't currently allow composing LINQ operators over collections within JSON documents, e.g.:
ctx.Entity.Where(e => e.JsonThing.Track.Segments.Any(s => s.HR > 130)
While the JSONPATH language was created for this purpose, support for it is very limited across databases, with the exception of PostgreSQL (see docs).
However, databases do provide ways of converting JSON arrays to a standard relational rowset, which can then be queried via usual SQL operators. We've already implemented support for these mechanisms (OPENJSON on SQL Server, json_each on SQLite) as part of primitive collections (#30426); we could extend that support to also work for non-primitive collections within JSON.
Originally suggested in #4021 (comment)
Eli-Black-Work, wstaelens, YZahringer, alienwareone, Bett-A-Fish and 166 moreaminamiridarban, Felipe379, jojoman2, hhiliahh, AslanAmca and 9 morewstaelens, dimgiatz, angelyordanov, lucapisano, marcominerva and 7 more