に円形構造の変換私はAngularJSフォームからのCouchbaseでの単純なCRUD操作をやろうとしているが、私はこのエラーを取得しておいてください。ここではCouchbaseの挿入 - 例外TypeError:JSON
TypeError: Converting circular structure to JSON
はからの主なスニペットですAngularJSとExpress.js。どんな助けでも大歓迎です。端末から
//AngularJS
$http.post('docs', $scope.doc).then(function(res) {
console.log(res);
}, function(err) {
console.log(err);
});
//Express.js
router.post('', function(req, res, next) {
db.upsert('anyname', req.body, function(error, result) {
if (error) {
console.log('operation failed', error);
return;
}
res.send(res);
});
});
詳細なエラー:
/Users/name/Workspace/sb-couchbase/node_modules/express/lib/response.js:242
var body = JSON.stringify(val, replacer, spaces);
^
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at ServerResponse.json (/Users/name/Workspace/sb-couchbase/node_modules/express/lib/response.js:242:19)
at ServerResponse.send (/Users/name/Workspace/sb-couchbase/node_modules/express/lib/response.js:151:21)
at /Users/name/Workspace/sb-couchbase/routes/document.js:36:8