I was pleased to realise I could create and query views via the sync gateway rest api on the admin port. I have been doing some tests and am having a problem with views updating.
If I add a design doc with views, then add a couple of docs using puts via the sync gateway and then query the view that ought to include the new docs they are not listed. If I use the web console to check the view they are there. If I try querying again after checking in the console then I get the correct response. It looks like the couchbase server views are not being updated when new documents are added via sync gateway but are if nudged in the console.
Is there some way to ensure the views are updated on writing new docs, or can I specify something in the query (a reference to DB state from the previous puts?) to ensure the new documents are included?
Maybe there’s some caching going on somewhere?