Zetax
Explore posts from serversDTDrizzle Team
•Created by Zetax on 7/17/2023 in #help
Updating jsonb objects with Drizzle?
Hey there, i'm currently working on migrating my database and code from MongoDB with Mongoose to Postgres with Drizzle and have encountered a question that I couldnt find answered on the docs.
I query JSON like this in my MongoDB database
Which updates the
profiles.athena.items
object in my database, now instead of having one big profiles blob, I created seperate columns for each profile in my drizzle schema and database. These are:
As I'm very new to drizzle and SQL in general, I'm not really sure how to approach querying this now. With MongoDB it was just a single findOneAndUpdate query, but in Drizzle i'm not sure how I can update just a single object inside my JSONB data. Could anyone give me an idea for how this could be done?2 replies