How to upgrade from couchbase lite 1.2 to 3.1?

First of all, CBL’s ResultSet Swift class doesn’t implement underestimatedCount and the default implementation from the Sequence protocol will return 0. You may try the following.

  1. Check the number of docs by calling collection.count.
  2. From the query, you can do rs.allResults().count.