Help with conflicts in CBL Android

I’m looking into a weird conflict problem I get in Android from time to time (doesn’t appear to happen in IOS).

How do I get the conflicts information using the REST API?


Try this:



Is there a way to get only documents that have conflicts ?


// Let's find the documents that have conflicts so we can resolve them:

Query query = database.createAllDocumentsQuery();


QueryEnumerator result =;

for (Iterator<QueryRow> it = result; it.hasNext(); ) {
    QueryRow row =;
    if (row.getConflictingRevisions().size() > 0) {
        Log.w("MYAPP", "Conflict in document: %s", row.getDocumentId());


THE OG method stems from here:

function(doc) {
  if(doc._conflicts) {
    emit(doc._conflicts, null);

Source: Conflict Management

Thanks. I’m using the rest_api and the only_conflicts parameter isn’t documented. I recall when I tried it it didn’t seem to work on android. But I’ll try the view method, that looks good.