couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r673631 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js src/couchdb/couch_httpd.erl
Date Thu, 03 Jul 2008 09:16:07 GMT
Author: jan
Date: Thu Jul  3 02:16:06 2008
New Revision: 673631

URL: http://svn.apache.org/viewvc?rev=673631&view=rev
Log:
Expose endkey_docid as a view query option through the HTTP API (including tests).

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js
    incubator/couchdb/trunk/src/couchdb/couch_httpd.erl

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=673631&r1=673630&r2=673631&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Thu Jul  3 02:16:06 2008
@@ -900,6 +900,54 @@
         T(queryResults.rows[j].key == i + j);
       }
     }
+    
+    // test endkey_docid
+    var queryResults = db.query(function(doc) { emit(null, null);}, null, {
+      startkey: null,
+      startkey_docid: 1,
+      endkey: null,
+      endkey_docid: 40
+    });
+    
+    T(queryResults.rows.length == 35)
+    T(queryResults.total_rows == docs.length)
+    T(queryResults.offset == 1)
+    T(queryResults.rows[0].id == "1");
+    T(queryResults.rows[1].id == "10");
+    T(queryResults.rows[2].id == "11");
+    T(queryResults.rows[3].id == "12");
+    T(queryResults.rows[4].id == "13");
+    T(queryResults.rows[5].id == "14");
+    T(queryResults.rows[6].id == "15");
+    T(queryResults.rows[7].id == "16");
+    T(queryResults.rows[8].id == "17");
+    T(queryResults.rows[9].id == "18");
+    T(queryResults.rows[10].id == "19");
+    T(queryResults.rows[11].id == "2");
+    T(queryResults.rows[12].id == "20");
+    T(queryResults.rows[13].id == "21");
+    T(queryResults.rows[14].id == "22");
+    T(queryResults.rows[15].id == "23");
+    T(queryResults.rows[16].id == "24");
+    T(queryResults.rows[17].id == "25");
+    T(queryResults.rows[18].id == "26");
+    T(queryResults.rows[19].id == "27");
+    T(queryResults.rows[20].id == "28");
+    T(queryResults.rows[21].id == "29");
+    T(queryResults.rows[22].id == "3");
+    T(queryResults.rows[23].id == "30");
+    T(queryResults.rows[24].id == "31");
+    T(queryResults.rows[25].id == "32");
+    T(queryResults.rows[26].id == "33");
+    T(queryResults.rows[27].id == "34");
+    T(queryResults.rows[28].id == "35");
+    T(queryResults.rows[29].id == "36");
+    T(queryResults.rows[30].id == "37");
+    T(queryResults.rows[31].id == "38");
+    T(queryResults.rows[32].id == "39");
+    T(queryResults.rows[33].id == "4");
+    T(queryResults.rows[34].id == "40");
+
   },
 
   view_sandboxing: function(debug) {

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=673631&r1=673630&r2=673631&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd.erl Thu Jul  3 02:16:06 2008
@@ -653,6 +653,8 @@
             Args#view_query_args{start_key=JsonKey,end_key=JsonKey};
         {"startkey_docid", DocId} ->
             Args#view_query_args{start_docid=DocId};
+        {"endkey_docid", DocId} ->
+            Args#view_query_args{end_docid=DocId};
         {"startkey", Value} ->
             Args#view_query_args{start_key=cjson:decode(Value)};
         {"endkey", Value} ->



Mime
View raw message