Skip to content

Loading…

Add support for POST ing a set of keys to _view #22

Closed
wants to merge 2 commits into from

2 participants

@clefru

Sorry, my last pull request was on a flawed version. I was a little bit distracted by learning how to use github that I commited an obsolete version. This version should work. Clemens

@clefru

Sorry, please disregard that pull request. The version I git commited was flawed :/

@felixge
Owner

Sorry, but I'm getting a merge conflict when trying to apply this. Are you sure it's based on the right version this time?

@felixge
Owner

Sorry to let you know, but I have decided to no longer maintain this module. The main reason is that I currently don't have any active project involving couchdb whatsoever, so maintaining this module has become an unmanageable burden. That being said, if somebody is interested in becoming the maintainer, let me know.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/couchdb.js
View
9 lib/couchdb.js
@@ -542,12 +542,21 @@ Db.prototype.viewCleanup = function(cb) {
};
Db.prototype.view = function(design, view, query, cb) {
+ var method = "GET";
+ var data = undefined;
if (typeof(query) === 'function' && !cb) {
cb = query;
query = undefined;
}
+ if (query && query['keys']) {
+ method = "POST";
+ data = JSON.stringify({"keys": query['keys']});
+ delete query['keys'];
+ }
return this.request({
+ method: method,
path: ['', ensureDesignId(design), '_view', view].join('/'),
+ data: data,
query: query
}, cb);
};
Something went wrong with that request. Please try again.