Skip to content

Instantly share code, notes, and snippets.

@xsyn
Created May 22, 2011 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xsyn/985550 to your computer and use it in GitHub Desktop.
Save xsyn/985550 to your computer and use it in GitHub Desktop.
Cradle callback issue
DreamModel.prototype.findAll = function(callback) {
this.db.view('dream/all', function(err, res) {
if (err) {
console.log(err)
} else {
var docs = [];
res.forEach(function (row) {
docs.push(row);
});
callback(null, docs);
}
});
};
Returns this error:
/Users/xsyn/Development/didit.co.za/models/dreamModel.js:22
callback(null, docs);
^
TypeError: string is not a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment