Skip to content

Commit

Permalink
Add a section to the FAQ on order by prop of a Json value
Browse files Browse the repository at this point in the history
This addresses this doc [issue](https://github.com/prisma/docs/issues/42660)
  • Loading branch information
ludralph authored Dec 5, 2024
1 parent e7d463c commit 8bfbf33
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,10 @@ No - it is not yet possible to filter on the presence of a specific key.

No - [case insensitive filtering](https://github.com/prisma/prisma/issues/7390) is not yet supported.

### Can you sort an object property of a Json value?

No - [Sorting](https://github.com/prisma/prisma/issues/10346) an object property (order-by-prop) of a Json value is not yet supported.

### How to set a default value for JSON fields?

When you want to set a `@default` value the `Json` type, you need to enclose it with double-quotes inside the `@default` attribute (and potentially escape any "inner" double-quotes using a backslash), for example:
Expand All @@ -1011,4 +1015,4 @@ model User {
json1 Json @default("[]")
json2 Json @default("{ \"hello\": \"world\" }")
}
```
```

0 comments on commit 8bfbf33

Please sign in to comment.