I'm trying to read the return value from a CouchDB _update, which returns a string. I'm calling it via an AngularJS $resource, like so:
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);
This prints the following to the console:
Object { 0: "4", 1: "d", 2: "a", 3: "7", 4: "3", 5: "1", 6: "1", 7: "4", 8: "-", 9: "8", 51 more… }
The attributes with the numeric indexes are my desired output, but how to convert them back into a string?
I've tried rtn.join("") but it complains about not finding rtn.join. I suspect this of being obvious, but I'm stuck for now...