0
に作成バルク文書を使用しようとしている私は私のcloudantデータベースに複数のドキュメントを挿入しようとしていますが、私はエラーを取得しながら、:JSONエラーのCouchDB(Cloudant)データベースこの<a href="https://docs.cloudant.com/document.html#bulk-operations" rel="nofollow noreferrer">https://docs.cloudant.com/document.html#bulk-operations</a> パー
{
"error": {
"statusCode": 400,
"name": "Error",
"request": {
"method": "POST",
"headers": {
"content-type": "application/json",
"accept": "application/json"
},
"uri": "https://XXXXXX:[email protected]/ttt/_bulk_docs",
"body": "[{\"name\":\"Nicholas\",\"_id\":\"96f898f0-f6ff-4a9b-aac4-503992f31b01\",\"_attachments\":{},\"age\":45,\"gender\":\"male\"},{\"name\":\"Taylor\",\"_id\":\"5a049246-179f-42ad-87ac-8f080426c17c\",\"_attachments\":{},\"age\":50,\"gender\":\"male\"},{\"name\":\"Owen\",\"_id\":\"d1f61e66-7708-4da6-aa05-7cbc33b44b7e\",\"_attachments\":{},\"age\":51,\"gender\":\"male\"}]"
},
"description": "couch returned 400",
"scope": "couch",
"reason": "Request body must be a JSON object",
"error": "bad_request",
"stack": "Error: Request body must be a JSON object\n at Request._callback (/nodejsAction/node_modules/cloudant-nano/lib/nano.js:247:15)\n at Request.self.callback (/nodejsAction/node_modules/request/request.js:186:22)\n at emitTwo (events.js:106:13)\n at Request.emit (events.js:191:7)\n at Request.<anonymous> (/nodejsAction/node_modules/request/request.js:1081:10)\n at emitOne (events.js:96:13)\n at Request.emit (events.js:188:7)\n at IncomingMessage.<anonymous> (/nodejsAction/node_modules/request/request.js:1001:12)\n at IncomingMessage.g (events.js:291:16)",
"message": "Request body must be a JSON object",
"errid": "non_200",
"headers": {
"statusCode": 400,
"x-couchdb-body-time": "0",
"cache-control": "must-revalidate",
"uri": "https://XXXXXX:[email protected]/ttt/_bulk_docs",
"x-cloudant-backend": "bm-cc-dal-01",
"date": "Sat, 20 May 2017 12:11:37 GMT",
"content-type": "application/json",
"via": "1.1 lb1.bm-cc-dal-01 (Glum/1.34.0)",
"x-couch-request-id": "fed1512052",
"x-content-type-options": "nosniff",
"strict-transport-security": "max-age=31536000"
}
}
}
私は入力を取りましたJSONを例のドキュメントから取り出し、それをオンラインのJSONバリデーターにチェックしてみましたが、これは大丈夫と思われます。 私は間違っていますか?