I am trying to run a select query with an IN statement using N1QL ,
JsonObject Val = JsonObject.create().put(“Data1”, Arrays.asList(1,2)).put(“CurrDt”, CurrentDate);
String query="select * from TABLE where field IN $Data1 and Date = CurrentDate;
N1qlQueryResult result1 = bucket.query(N1qlQuery.parameterized(query,Val));
The above code is running into errors,
“Error-java.lang.ClassCastException: com.couchbase.client.java.document.json.JsonArray cannot be cast to java.lang.String”.
Is there something wrong with the above approach or can you suggest other ways to pass a dynamic array of string into “IN” statement?
Any help would be much appreciated.
Thanks in advance!