【发布时间】:2019-05-29 20:10:30
【问题描述】:
最初我有 JSON 哈希值,例如, a = {“1”:1,“2”:2}。 (初始 json 哈希)
现在我需要将新的键值对添加到 json 哈希中 { "3": 3 }.( 新的哈希密钥对)
合并新值后,我的哈希看起来像 a = {“1”:1,“2”:2,“3”:3}。 (结果json哈希)
Can you please share your logic for satisfying the above conditions for multiple objects?
Note: 1. My column is not a jsonb. It's a json column.
2. I am using the postsgres database.
3. Merge the key-value pair to multiple objects columns.
【问题讨论】:
-
你的 PostgreSQL 版本是多少?
标签: ruby-on-rails json postgresql