Getting the latest change seq number in couchbase lite


#1

I’m trying to determine the seq number for the most recent change in couchbase lite. I tried using the _changes_ feed, passing in limit=1 and descending=true, but it quickly caused an out of memory error in android (inside a collections.sort() call).

I then tried to get the value by using the etag header from the changes feed. It worked nicely on OIS but was not present on android. The headers in android looked like this:

{ map:  { 'okhttp-received-millis': [ '1459037138183' ],
'okhttp-sent-millis': [ '1459037137573' ],
'keep-alive': [ 'timeout=30, max=100' ],
connection: [ 'keep-alive' ],
'okhttp-selected-protocol': [ 'http/1.1' ],
'transfer-encoding': [ 'chunked' ],
date: [ 'Sun, 27 Mar 2016 00:05:37 GMT' ],
server: [ 'D. Rogatkin\'s TJWS with Android support (aka Acme.Serve)/Version 1.105, $Revision: 1.267 $,Couchbase Lite 1.1.0-null' ],
'mime-version': [ '1.0' ],
content-type': [ 'application/json' ] } }

… no etag.

Is there another way?


#2

The latest sequence should be present in the return value of the call to GET /{db} in the update_seq property if you are interested in the database level.


#3

Of course, thank you