couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [11/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf
Date Tue, 01 Apr 2014 08:52:16 GMT
list functionality for jquery.couch.js

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@939443 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/commit/283b1840
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/tree/283b1840
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/diff/283b1840

Branch: refs/heads/import-master
Commit: 283b18407010dc5d2b4f764c0487166b040b4f86
Parents: f3b1d06
Author: John Christopher Anderson <jchris@apache.org>
Authored: Thu Apr 29 18:33:37 2010 +0000
Committer: Alexander Shorin <kxepal@gmail.com>
Committed: Thu Apr 29 18:33:37 2010 +0000

----------------------------------------------------------------------
 jquery.couch.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/blob/283b1840/jquery.couch.js
----------------------------------------------------------------------
diff --git a/jquery.couch.js b/jquery.couch.js
index 4168a4b..d197ba3 100644
--- a/jquery.couch.js
+++ b/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 || {};


Mime
View raw message