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?1 Reply
Addition: I realise I can just get the "profile" and then replace values of it with nodejs and then update it again, but that seems very ineffecient