Hi,
I need help with a query i use in java (Android):
The database is like this:
{
"YEAR": 2017,
"CAUS": "",
"NMBH": "xxxxxxxxx",
"NAME": "xxxxxxx",
"OFF": "First Road 1",
"FULLTIME": "xxxxxx",
"FUNCTION": "xxxxxxxx",
"OFFADDR": "xxxxxxx",
"MATR": "123456",
"MONTH": "11",
"QUAL": "xxxxxx",
"TDES": "xxxxxxx",
"UCOD": 1324132,
"UFFAPPL": "xxxxx",
"UNITAPROD": "xxxxxxxx",
"id": "1324234",
"t_ter_REG": "xxxxxxxx,
"_rev": "1-cd2be12c983d43228d2d641da9a30f6b",
"_id": "0061167"}
Here is the query:
Query query = QueryBuilder
.select(SelectResult.all())
.from(DataSource.database(database))
.where(Expression.property("OFF").equalTo(Expression.string("First Road 1")))
.orderBy(Ordering.property("NAME").ascending())
.limit(Expression.intValue(25));
ResultSet rs = null;
try {
rs = query.execute();
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
for (Result result : rs) {
int a=0;
a=a+1;
Log.e("Sample", String.format("%s", result.getString(a)));
android.util.Log.e(TAG, String.format("%s", result.toMap()));
}
I don’t get any result in the log, and I tried several times.
The fields are all indexed, and the databse syncs: I tried using an document ID (writing directly) and it works perfectly.
The only thing I obtain from the debugger is:
I/Sync: statusChanged() c4Status -> C4ReplicatorStatus{activityLevel=4, progressUnitsCompleted=412, progressUnitsTotal=412, progressDocumentCount=1, errorDomain=1, errorCode=26, errorInternalInfo=1000}
I/Sync: C4ReplicatorListener.statusChanged() status -> C4ReplicatorStatus{activityLevel=3, progressUnitsCompleted=412, progressUnitsTotal=412, progressDocumentCount=1, errorDomain=1, errorCode=26, errorInternalInfo=1001}
I/Sync: Replicator[<*> Database@38449ae{name='iscritti'} URLEndpoint{url=ws://192.168.50.160:4984/iscritti}] is busy, progress 412/412, error: CouchbaseLiteException{domain='CouchbaseLite', code=26, msg=Document update conflict}
I/Sync: statusChanged() c4Status -> C4ReplicatorStatus{activityLevel=3, progressUnitsCompleted=412, progressUnitsTotal=412, progressDocumentCount=1, errorDomain=0, errorCode=0, errorInternalInfo=0}
I/Sync: Replicator[<*> Database@38449ae{name='iscritti'} URLEndpoint{url=ws://192.168.50.160:4984/iscritti}] is idle, progress 412/412, error: null
I/Sync: statusChanged() c4Status -> C4ReplicatorStatus{activityLevel=3, progressUnitsCompleted=412, progressUnitsTotal=412, progressDocumentCount=1, errorDomain=1, errorCode=26, errorInternalInfo=1001}
I/Sync: Replicator[<*> Database@38449ae{name='iscritti'} URLEndpoint{url=ws://192.168.50.160:4984/iscritti}] is idle, progress 412/412, error: CouchbaseLiteException{domain='CouchbaseLite', code=26, msg=Document update conflict}
E/Replication Comp Log: Schedular Completed
E/ert: Error code:: 26
What is the error 26? I couldn’t find the description in the documentation.
Thank you for the help.