I have just deployed a new iOS-Couchbase application on my iPad and have noticed that the views, once queried, do not update according to the changes in the database. It is as if the view was not refreshed after a document creation/update.
I have simplified the problem to the point that I can exhibit this problem with the simplest view:
function(doc) {
emit(doc._id,null);
}
When this view is first called, the appropriate information is returned (list of document ids). This is pretty much the same as db/_all_docs.
However, subsequent calls to the same view continue to show the same result, even though changes took place in the database.
Loading this into the iOS Simulator, I notice the following behaviour:
1. The first time that the view is requested, a log line is reported in the XCode debugger window:
>1 [info] [<0.709.0>] 127.0.0.1 - - GET /demo/_design/mobile/_view/identity?onlyRows=true 200
At that point, the result is correct.
2. After creating a new document, the view is called again. The reported debug line is:
>1 [info] [<0.1013.0>] 127.0.0.1 - - GET /demo/_design/mobile/_view/identity?onlyRows=true 304
Yet, the view needs to be update and new results should be reported. If calling _all_docs, then the HTTP code is 200 and the right results are returned.
Here are my questions:
1. Is this a known bug?
2. Is there a way to prompt CouchDb to refresh its views?
3. What component is returning the 304 and where should I file this bug?
4. Are there a INI settings to influence the behaviour of view indexing?
Thanks,
JP