Can I get changes in CBL 2.0?

I want to get all the document changed after a specific sequenceID.

In 1.x, I can setup a CBL listener and use RestAPI (/{db}/_changes) to do that. Not sure why 1.x Native Api doesn’t expose such functionality, but I still can get the changes with Rest API.

Is it possible to do in CBL 2.0 without SyncGateway?

No, the CBL Listener is not available in 2.0. See

You don’t need the listener for this in any version of CBL.

  • In 1.x, use a query with the mode bySequence and set the startKey to the first sequence you want.
  • In 2.x, create a query for sequences greater than or equal to the first one you want. (I’m not very familiar with the new query syntax, but there is an available document property for its sequence.)

Thank you very much for the information.

To add to what Jens specified w.r.t. 2.0, an example of how you do this in swift (translate to language of choice)

   // lastSeqNum is used to track the last seq num. It starts with 0. 

    let searchQuery = QueryBuilder
        .select( SelectResult.expression(

You may want to add an orderBy(Meta.sequence) to that, otherwise the order of results will be undefined.

1 Like