我试图从CouchDB _update中读取返回值,该值返回一个字符串。我通过AngularJS $资源调用它,如下所示:
var cb = function(rtn){console.log(rtn);};
var foo = $resource('/myDb/_design/myDesignDoc/_update/thingie/:arg', {}, { update: {method: 'PUT'}});
foo.update({arg: "blah"}, null, cb);
这会将以下内容输出到控制台:
Object { 0: "4", 1: "d", 2: "a", 3: "7", 4: "3", 5: "1", 6: "1", 7: "4", 8: "-", 9: "8", 51 more… }
数字索引的属性是我想要的输出,但是如何将它们转换回字符串?
我已经尝试rtn.join("")
,但它抱怨找不到rtn.join
。我怀疑这是显而易见的,但我现在被困住了......