couchbase_lite icon indicating copy to clipboard operation
couchbase_lite copied to clipboard

iN() not working properly. It is returning all records in that documentType.

Open SwapnilDhotre opened this issue 5 years ago • 1 comments

Describe the bug Issue with iN() query in flutter CouchBase. in() works fine in iOS as I am iOS developer I have used it before too. But in flutter it returns all the records under that documentType.

To Reproduce Steps to reproduce the behavior:

  1. Use iN() and pass expressions list to it.
  2. I have only 3 documents in couchbase_db having ids as 1, 2, 3 in int format. I have just passed 1 in below expression it returns all 3 documents. I thought issue with my query but just replaced iN() with equalTo(expressions[0]) it works fine.

List<Expression> expressions = [idsArray.map((id)](url) => Expression.string(id)).toList(); Query query = QueryBuilder.select([SelectResult.all()]) .from("couch_db") .where(Expression.property("documentType") .equalTo(Expression.string("student")) .and(Expression.property("id").iN(expressions)));

Expected behavior It should return only documents that are related to List<Expressions> passed in where query.

Screenshots screen_shot

Desktop:

  • macOS for development and iOS device / Android device(In android emulator it shows only 2 documents 1, 3 tried by passing any id)

SwapnilDhotre avatar Feb 13 '20 07:02 SwapnilDhotre

I will take a quick look and see if anything obvious jumps out at me. Please let me know if you figure out anything.

bawelter avatar Mar 20 '20 13:03 bawelter