Sort by property of Json
field
#24122
Labels
domain/client
Issue in the "Client" domain: Prisma Client, Prisma Studio etc.
domain/schema
Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.
kind/feature
A request for a new feature.
topic: Json
Scalar type `Json`
topic: orderBy / sorting
Problem
At the moment looks impossible - through Prisma - to define sort order by property of json field. Postgres allow this with the following syntax (for instance):
select id, "additionalFields"->'jsonProperty'->>'fieldName' from "Table" t
order by "additionalFields"->'jsonProperty'->>'fieldName' desc
Suggested solution
Associate a new SortOrderJson class to json fields, where a property "path" can define the property to sort for
The text was updated successfully, but these errors were encountered: