couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasondav...@apache.org
Subject svn commit: r949037 - /couchdb/trunk/share/www/script/jquery.couch.js
Date Thu, 27 May 2010 23:00:09 GMT
Author: jasondavies
Date: Thu May 27 23:00:09 2010
New Revision: 949037

URL: http://svn.apache.org/viewvc?rev=949037&view=rev
Log:
Add support for multi-document-fetch (via _all_docs) to jquery.couch.js.

Modified:
    couchdb/trunk/share/www/script/jquery.couch.js

Modified: couchdb/trunk/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=949037&r1=949036&r2=949037&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Thu May 27 23:00:09 2010
@@ -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