enable multi-key-get in jquery.couch.js, patch by Benoit Chesneau, closes COUHCDB-376
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@814364 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/jquery.couch.js b/jquery.couch.js
index 8e51727..5d189b2 100644
--- a/jquery.couch.js
+++ b/jquery.couch.js
@@ -249,8 +249,20 @@
);
},
view: function(name, options) {
- name = name.split('/');
+ var name = name.split('/');
+ var options = options || {};
+ var type = "GET";
+ var data= null;
+ if (options["keys"]) {
+ type = "POST";
+ var keys = options["keys"];
+ delete options["keys"];
+ data = toJSON({ "keys": keys });
+ console.log(data);
+ }
ajax({
+ type: type,
+ data: data,
url: this.uri + "_design/" + name[0] +
"/_view/" + name[1] + encodeOptions(options)
},