SG View query not updating.

27 views
Skip to first unread message

Todd Freese

unread,
Jun 30, 2015, 12:54:40 AM6/30/15
to mobile-c...@googlegroups.com
Been testing creating/querying views in the sync gateway and it seems the views are not automatically updating. If a new document is created via CBL IOS and pushed to the server, the first REST SG view query does not show the doc. But after a second query to the SG, the doc shows up. Seems like the first query is forcing the view to update.

Are SG views auto updated after a sync? Or is this the normal behavior?

Server is a Mac running SG 1.1.0 and CBS 3.0.3. The IOS client is using CBL 1.1. The REST calls are on the SG admin port.

Todd

ajres

unread,
Jun 30, 2015, 6:34:24 AM6/30/15
to mobile-c...@googlegroups.com
@Todd

The SG views pass queries through to Couchbase Server views, so Couchbase Server view semantics apply.

This page shows the view query API in Couchbase Server: http://docs.couchbase.com/admin/admin/Views/views-querying.html

If you add the query parameter:

stale=false

to your query it should force the view to re-index before returning any results.

Note: The value for this property is a String not a Boolean.

Andy

Todd Freese

unread,
Jun 30, 2015, 11:28:17 AM6/30/15
to mobile-c...@googlegroups.com
Awesome. Thanks!

Todd
Reply all
Reply to author
Forward
0 new messages