【发布时间】:2016-05-05 23:49:45
【问题描述】:
所以我有一个像这样的数据结构......字典......
fbIds = ["him", "her", "it", "that"]
然后我有一个数据库,我正在将一个 json 结构添加到...
res = r.table("usa_nyc_bronx_merchants").insert({
"street_address": streetName.lower(),
"city": cityName.lower(),
"state": stateName.lower(),
"zipcode": zipcodeNumber.lower(),
"county": countyName.lower(),
"fbIds": [ADD DICTIONARY ITEMS TO THIS ARRAY]
.....
我如何将该字典中的项目添加到该 json 数组中...请注意 所有这些代码都已经在一个 for 循环中了。
谢谢!
【问题讨论】:
-
fbIds已经是一个数组,所以这看起来应该很简单......如果您在上面的示例中也包含了 for 循环,那么我们可以更好地了解你想要完成的事情。
标签: python json loops in-place