slower_loris
PPrisma
•Created by slower_loris on 6/27/2024 in #help-and-questions
Preserve key order when writing JSON fields
I am using Prisma with Postgres and I have the following JSON data that I want to insert into my table:
{"First Section":[{"title":"Heading 1","body":"Body 1"}],"Second Section":[{"title":"Heading 2","body":"Body 2"}],"Final Section":[{"title":"Heading 3","body":"Body 3"}]}
To save it to my database, I'm using upsert:
When I then query that record, I get the JSON returned with the following key order:
Is there any way to preserve the order of the keys when writing the data to postgres?3 replies