summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-04-29 18:33:37 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-04-29 18:33:37 +0000
commit29fd68097060949adf1adc0292cb51458626cc85 (patch)
tree584b80b277d1313c9c435a90a97b9e7136263667
parentcbfb602d251557668146b2a28f8e58038c613318 (diff)
list functionality for jquery.couch.js
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@939443 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--share/www/script/jquery.couch.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js
index 2b680d9c..71560181 100644
--- a/share/www/script/jquery.couch.js
+++ b/share/www/script/jquery.couch.js
@@ -352,6 +352,26 @@
"An error occurred querying the database"
);
},
+ list: function(list, view, options) {
+ var list = list.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 });
+ }
+ ajax({
+ type: type,
+ data: data,
+ url: this.uri + '_design/' + list[0] +
+ '/_list/' + list[1] + '/' + view + encodeOptions(options)
+ },
+ options, 'An error occured accessing the list'
+ );
+ },
view: function(name, options) {
var name = name.split('/');
var options = options || {};