Hi,
In PostgreSQL, I have a JSONB column named custom with for instance this data: {"firmanavn": "Eliksir", "value": 123}. I can do a query such as this to remove the "firmanavn" key from the column:
UPDATE contacts SET custom = custom - 'firmanavn' WHERE custom ? 'firmanavn';
I have not found a way to batch-update JSON columns such as this in SQLAlchemy. The column is defined as: custom = Column(MutableDict.as_mutable(JSONB))
Is there a way? Looping over filtered models and deleting the keys per model obviously doesn't scale very well...
Thanks,
Anders Steinlein
Gründer av MailMojo hos Eliksir AS
mob: +47 926 13 069
tlf: 21 42 30 30