couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [17/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf
Date Tue, 01 Apr 2014 08:52:22 GMT
Add support for multi-document-fetch (via _all_docs) to jquery.couch.js.

git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@949037 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/92a9595c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/tree/92a9595c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/diff/92a9595c

Branch: refs/heads/import-master
Commit: 92a9595cd3461456758bf3c6bb74ef826a1eb64f
Parents: 694e733
Author: Jason David Davies <jasondavies@apache.org>
Authored: Thu May 27 23:00:09 2010 +0000
Committer: Alexander Shorin <kxepal@gmail.com>
Committed: Thu May 27 23:00:09 2010 +0000

----------------------------------------------------------------------
 jquery.couch.js | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jquery-couch/blob/92a9595c/jquery.couch.js
----------------------------------------------------------------------
diff --git a/jquery.couch.js b/jquery.couch.js
index 99d97f5..4ce7549 100644
--- a/jquery.couch.js
+++ b/jquery.couch.js
@@ -231,8 +231,19 @@
           );
         },
         allDocs: function(options) {
-          ajax(
-            {url: this.uri + "_all_docs" + encodeOptions(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 + "_all_docs" + encodeOptions(options)
+            },
             options,
             "An error occurred retrieving a list of all documents"
           );


Mime
View raw message