Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Using a JSON field as an id - Prisma
P
Prisma
•
15mo ago
•
3 replies
PIat
Using a JSON field as an id
Hello
! I want to cache API results in the database and I was wondering if it
'd be possible to use the
id
id
in the JSON field as an id
, perhaps through
@@id
@@id
or some client extension
?
Solution
Hello
@PIat
You could store the API result in a JSON field and also store the ID you want to use in a separate field marked as
@id
@id
. However it won
't be possible to skip having an
id
id
field altogether
.
You can use a client extension to manipulate the data before saving it to the database
. So essentially
, getting the
id
id
from JSON and using the same value in the actual
id
id
column
Jump to solution
Prisma
Join
The official Discord server of Prisma! Find us online at prisma.io
9,819
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
@relation field referencing a compound id
P
Prisma / help-and-questions
2y ago
TypeScript issue with JSON[] field filter using path
P
Prisma / help-and-questions
14mo ago
Insert `Map` as `Json`
P
Prisma / help-and-questions
14mo ago
Mulitple index for json field
P
Prisma / help-and-questions
8mo ago