couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r720384 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js src/couchdb/couch_httpd_db.erl
Date Tue, 25 Nov 2008 02:47:39 GMT
Author: jchris
Date: Mon Nov 24 18:47:39 2008
New Revision: 720384

URL: http://svn.apache.org/viewvc?rev=720384&view=rev
Log:
_all_docs_by_seq works with descending=true

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js
    incubator/couchdb/trunk/src/couchdb/couch_httpd_db.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=720384&r1=720383&r2=720384&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] Mon Nov 24 18:47:39 2008
@@ -171,6 +171,14 @@
       T(row.id == ids[i]);
     };
     
+    // it should work in reverse as well
+    all_seq = db.allDocsBySeq({descending:true});
+    ids = ["2","1","3","0"];
+    for (var i=0; i < all_seq.rows.length; i++) {
+      var row = all_seq.rows[i];
+      T(row.id == ids[i]);
+    };
+    
     // check that deletions also show up right
     var doc1 = db.open("1");
     var deleted = db.deleteDoc(doc1);

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=720384&r1=720383&r2=720384&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd_db.erl Mon Nov 24 18:47:39 2008
@@ -186,6 +186,7 @@
     StartKey2 = case StartKey of
         nil -> 0;
         <<>> -> 100000000000;
+        {} -> 100000000000;
         StartKey when is_integer(StartKey) -> StartKey
     end,
     {ok, FoldResult} = couch_db:enum_docs_since(Db, StartKey2, Dir,



Mime
View raw message