You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2014/04/01 10:52:22 UTC

[17/50] jquery-couch commit: updated refs/heads/import-master to 66dbcbf

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 <ja...@apache.org>
Authored: Thu May 27 23:00:09 2010 +0000
Committer: Alexander Shorin <kx...@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"
           );