Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python数据库中的JSON结构_Python_Couchdb - Fatal编程技术网

Python数据库中的JSON结构

Python数据库中的JSON结构,python,couchdb,Python,Couchdb,我想使用API将数据发布到我的CouchDB 这是我发布的已创建文档 { "_id": "file1_benchmark", "_rev": "1-8efcf01444c3e47532445f81bdbe02b5", "id_stn": "104", "no_stn": "S 0221", } 这是我在模型中的结构 class Data(Document): _id = TextField(), id_stn = DictField(), no

我想使用API将数据发布到我的CouchDB

这是我发布的已创建文档

{
   "_id": "file1_benchmark",
   "_rev": "1-8efcf01444c3e47532445f81bdbe02b5",
   "id_stn": "104",
   "no_stn": "S 0221",

}
这是我在模型中的结构

class Data(Document):
    _id = TextField(),
    id_stn = DictField(),
    no_stn = DictField()

     ))
但我希望文档的结果如下所示:

{
       "_id": "file1_benchmark",
       "_rev": "1-8efcf01444c3e47532445f81bdbe02b5",
       {
       "id_stn": "104",
       "no_stn": "S 0221",
       },
       {
       "id_stn": "105",
       "no_stn": "S 0222",
       }

    }

更改我的模型的正确方法是什么?

它不完全是json。。。每个
{“id\u stn”:…}
子节点都需要一个属性名。我说的对吗?@Shai是的。。我需要子节点的属性