Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lists.withRows returns single record #2

Open
Masatoshi opened this issue Sep 14, 2011 · 0 comments
Open

lists.withRows returns single record #2

Masatoshi opened this issue Sep 14, 2011 · 0 comments

Comments

@Masatoshi
Copy link

i think it should be below.

// Helpers for writing server-side _list functions in CouchDB
exports.withRows = function(fun) {
  var f = function() {
    var l = [];
    while (row = getRow()){
        l.push(fun(row));
    }
    return l;
  };
  f.iterator = true;
  return f;
}
exports.send = function(chunk) {
  send(chunk + "\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant