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
web: mailmojo.no | e5r.no
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/CAC35HNkv18rsuzUd4p%3DXXY%3DW01PtG6egjCnLJgXrtacRCk9WuQ%40mail.gmail.com.