I use couchbase lite phonegap plugin in iOS and android hybrid app.

I have a view as follows which i initiate from my JavaScript code as 
follows 

function setupViews(db, cb) {
   //DESIGN DOCUMENT FOR ACCOUNT
   var design = "_design/account";
   db.put(design, {
     views: {
       ByType: {
         map: function(doc) {
           if (doc.type && doc.type == "account") {
             emit(doc.cat, doc);
           }
         }.toString()
       }
},function() {
     window.config.accountViews = db([design, "_view"]);
     generateCatDesginDoc(db, cb);
     //cb(false, db([design, "_view"]));
   });
}


I have read that it recommended that one should not emit whole document but 
in this specific use case i need to emit the whole document. Now i have 
about 100 documents added to couchbase and when i query this view for the 
very first time it goes and indexes it and takes about 5~6 seconds to 
complete and give me a result. This is a show stopper for me as there are 
two such view query's where the views are beign indexed for the first time 
and my app takes awfully long to complete the process(10 ~12 secs). I can't 
expect users to wait for such a long time.

In a normal couchbase server we can change the settings of couchbase server 
and instruct it to auto update the view after each specific time interval 
on its own regardless of the query. We do a post request as below and 
change the setting

http://192.168.1.100:8091/settings/viewUpdateDaemon

<http://www.google.com/url?q=http%3A%2F%2F192.168.1.100%3A8091%2Fsettings%2FviewUpdateDaemon&sa=D&sntz=1&usg=AFQjCNFBqVjIcRZ8ntZClPhapbPjswJeJw>I
 
also read that in native API there is some kind of parameter named "
indexUpdateMode" you can use while querying a view which can be used to 
trigger index update asynchronously in background. What i want is that my 
view indexes should be automatically updated after specified time interval 
rather then being updated when queried. I can't find a way to do via REST 
API for cblite. 

Any help would be really helpful.


-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/286180af-854a-4f33-b655-1ece6c94dc61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to