Skip to content

API for raw JSONPATH queries #2668

Open

Description

@roji

#2570 tracks translating LINQ operators inside JSON documents to JSONPATH. But just like we have raw SQL query APIs, we should also have a raw JSONPATH API, which allows the user to directly provide a JSONPATH string query and get results out. This would act as an escape hatch API for when we don't support a LINQ translation.

Ideal LINQ construct (part of #2570):

ctx.Entity.Where(e => e.JsonThing.Track.Segments.Any(s => s.HR > 130))

Escape hatch with raw JSONPATH (this issue):

ctx.Entity.Where(e => EF.Functions.Jsonpath<Segment>(e.JsonThing, "$.track.segments[*].HR ? (@ > 130)"))

Note: this was initially proposed at the EF relational level in #28824, but abandonned there after it was discovered that actual cross-database JSONPATH support tends to be very limited (PG is the exception).

Activity

  1. added this to the 8.0.0 milestone on Mar 1, 2023
  2. self-assigned this
    on Mar 1, 2023
  3. modified the milestones: 8.0.0, 9.0.0 on Nov 14, 2023
  4. modified the milestones: 9.0.0, Backlog on Sep 13, 2024
  5. added theissue type on Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions