On Thursday, 5 February 2015 02:24:02 UTC+5:30, Jens Alfke wrote: > > > You *really* shouldn't emit the whole document. Why do you need to in > this case? > > Below is my sample document from 100 documents that i have in db
account: "Charity" cat: "Expense" channels: "vinay" createdAt: "Thu Feb 05 2015 00:15:21 GMT-0500 (EST)" initialBal: "0" initialBalDate: "Thu Feb 05 2015 00:15:21 GMT-0500 (EST)" note: "" subCat: "Activities" type: "account" Now from from above 9 properties i need about 7 properties in my app from each document. So rather then emitting 7 different properties i emit the doc itself. Another way is that i emit : null from the view and then in a separate GET request get the document by passing the id i recieve in view query. But in that case when i need to get all these 100 docs i will have to first query my view which gives me 100 document id's and then i need to fire 100 ajax GET requests to get the complete doc itself. Hence the use of doc in emit of view. > That's a very long time; it should not take that log. (I think I said that > before.) Which platform does this occur on, and how big are your documents? > Also, what version of CBL? > > I profiled the app by watching the android logcat logs to find what happens when i query the view for the first time. All it shows is that there is re-indexing of views going on and as there are 100 docs it goes and re-indexes them and that process takes about 5~6 secs. The platform is Android (4.4.4). Also i use this on iOS too and time taken on iOS is little bit less then android. I am using cblite phonegap plugin version 1.0.2 which i pulled from github master branch. (Also somebody previosuly said that the plugin version on master branch is actually 1.0.3 but at least the config files and cordova CLI show me 1.0.2) > I'm guessing that your documents are pretty big, so emitting the entire > document is slow. > > You can see my sample doc. I am guessing 9 properties document shouldn't be that too big. > The CouchDB REST API for views has a "stale > <http://docs.couchdb.org/en/latest/api/ddoc/views.html>" parameter for > this, but I just looked at CBL code and we haven't implemented it. We > should, though; I've filed an issue > <https://github.com/couchbase/couchbase-lite-ios/issues/584>. > > —Jens > Thanks for filing the issue. What i exactly need right now is my specific view index being auto updated regardless of they are queried or not so that when i query them the index is always updated and the response time is quick. -- 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/5ad985e0-2b5e-47f6-8411-748a07435bf4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
