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
- Some other ones to add on from my fresh install: Start menu search will search the Microsoft Store for apps they want you to install, som...
- New Release?
- 【Not An Issue But Tutorial】A complete tutorial of pre-processing steps
- Meta issue: plugin system
- proposal: cmd/go: allow versioned `go build` commands
- [Proposal] New tutorial for "How to install PCL for windows x64 Visual Studio 2019"
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
onboarding (E-commerce)
Some other ones to add on from my fresh install: Start menu search will search the Microsoft Store for apps they want you to install, som...
New Release?
【Not An Issue But Tutorial】A complete tutorial of pre-processing steps
Meta issue: plugin system
Accept `Json` field paths when trying to order by `Json` field
proposal: cmd/go: allow versioned `go build` commands
[Proposal] New tutorial for "How to install PCL for windows x64 Visual Studio 2019"
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 ```
Comments (0)
No comments yet. Start the discussion.