IssueRaiser

Accept `Json` field paths when trying to order by `Json` field

### Bug description I'm trying to order my data by a value of a field in a json column, but Prisma doesn't accept the path structure that `where` accepts. It seems that this feature of PostgreSQL is not supported yet. ### How to reproduce Just write a query that tries to pass a `path` to the `orderBy` parameter (there is no such parameter). ### Expected behavior I expect it to work as it works with json filtering. Something like: ```ts orderBy: { myJsonField: { path: ["foo", "bar"], orderDirection: "asc" }, } ``` ### Prisma information You can try this with any json field. ### Environment & setup - OS: Windows - Database: PostgreSQL - Node.js version: v14.18.1 ### Prisma Version ``` 3.5.0 ```

Posted by bruce-forte on Nov 19, 2021, 10:09 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

onboarding (E-commerce)

Accept `Json` field paths when trying to order by `Json` field

bruce-forteNov 19, 2021, 10:09 AM

### Bug description I'm trying to order my data by a value of a field in a json column, but Prisma doesn't accept the path structure that `where` accepts. It seems that this feature of PostgreSQL is not supported yet. ### How to reproduce Just write a query that tries to pass a `path` to the `orderBy` parameter (there is no such parameter). ### Expected behavior I expect it to work as it works with json filtering. Something like: ```ts orderBy: { myJsonField: { path: ["foo", "bar"], orderDirection: "asc" }, } ``` ### Prisma information You can try this with any json field. ### Environment & setup - OS: Windows - Database: PostgreSQL - Node.js version: v14.18.1 ### Prisma Version ``` 3.5.0 ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue