我正在尝试将其保存到Cloudant数据库:
[
{
"_id": "document_one",
"heynow": [
{
"Name": "one",
"Duration": 2,
"DurationUnit": "Hours"
},
{
"Name": "two",
"Duration": 40,
"DurationUnit": "Minutes"
}
]
},
{
"_id": "document_two",
"heynow": [
{
"Name": "three",
"Duration": 2,
"DurationUnit": "Hours"
},
{
"Name": "four",
"Duration": 40,
"DurationUnit": "Minutes"
}
]
}
]
但显然它不喜欢外括号,因为它告诉我:
"error":"bad_request","reason":"Document must be a JSON object"
JSONLint说这是有效的,所以我想我问是否有人知道如何格式化这样可以将其输入Couchdb,因为外括号似乎导致了问题。